[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-bugs-dist
Subject: [Bug 108537] WISH lossless jpeg rotations change file date/time.
From: Renchi Raju <renchi () pooh ! tam ! uiuc ! edu>
Date: 2005-07-11 5:22:22
Message-ID: 20050711052222.17895.qmail () ktown ! kde ! org
[Download RAW message or body]
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
http://bugs.kde.org/show_bug.cgi?id=108537
renchi pooh tam uiuc edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
------- Additional Comments From renchi pooh tam uiuc edu 2005-07-11 07:22 -------
SVN commit 433539 by pahlibar:
preserve timestamp of image when rotating/flipping
BUG: 108537
M +25 -3 utils.cpp
--- trunk/extragear/libs/kipi-plugins/jpeglossless/utils.cpp #433538:433539
@ -28,6 +28,9 @
extern "C" {
#include <tiffio.h>
#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <utime.h>
}
#include "utils.h"
@ -125,11 +128,30 @
bool MoveFile(const QString& src, const QString& dst)
{
- if (!CopyFile(src,dst)) return false;
+ struct stat stbuf;
+ if (::stat(QFile::encodeName(dst), &stbuf) != 0)
+ {
+ kdWarning( 51000 ) << "KIPIJPEGLossLessPlugin:MoveFile: failed to stat src"
+ << endl;
+ return false;
+ }
+
+ if (!CopyFile(src,dst))
+ return false;
- if (::unlink(QFile::encodeName(src).data()) != 0) {
+ struct utimbuf timbuf;
+ timbuf.actime = stbuf.st_atime;
+ timbuf.modtime = stbuf.st_mtime;
+ if (::utime(QFile::encodeName(dst), &timbuf) != 0)
+ {
+ kdWarning( 51000 ) << "KIPIJPEGLossLessPlugin:MoveFile: failed to update dst time"
+ << endl;
+ }
+
+ if (::unlink(QFile::encodeName(src).data()) != 0)
+ {
kdWarning( 51000 ) << "KIPIJPEGLossLessPlugin:MoveFile: failed to unlink src"
- << endl;
+ << endl;
}
return true;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic