Version: (using KDE KDE 3.4.0) Installed from: SuSE RPMs OS: Linux lossless jpeg rotations change file date/time. Could this be made optional since I want to keep the original file date/time which is the date/time the photo was taken with my camera. I used Gwenview to do the rotations. The file is immediately stored, but there is no option to leave the timestamp untouched. Irfanview for example does this by default.
Where nothing is done to the image other than rotation it would definitely be preferable to keep the original date. I'll vote for it.
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; }