Bug? jpegtran rotate changes file dates of files not rotated

Started by pb, December 30, 2011, 05:47:19 PM

Previous topic - Next topic

pb

It appears that if one applies jpeg lossless autorotate to a set of files that includes files that do not need to be rotated (for example, an entire directory), exiftoolgui sets the filesystem date to the exif date even if the image data does not need to be modified (i.e., no rotation is required).  This is inconvenient for me, because I maintain actual filesystem modify dates for images that I have post-processed manually.

I'm going to guess that this occurs because exiftoolgui runs jpegtran indiscriminately on every file  -- giviing args to jpegtran which might actually be no-ops -- and changes dates afterwards.  I think we had some previous discussion about what the dates are set to, with the result that you added a warning, but I don't recall this exact problem being discussed.

It would be nice if exiftoolgui only ran jpegtran on files that needed it, thus not needing to modify the filesystem date.  (This assumes that jpegtran 'touches' the file even if it doesn't need to do anything, which is what I infer from the jpegtran man page.)  That would also speed things up if there is a significant number of files that do not need to be rotated.

Alternately, if it's too much trouble to change this behavior, maybe the existing warning could be expanded to say that every selected file will have its filesystem date set to the exif date, even if it is not rotated.

Unfortunately, I don't remember which version of exiftoolgui and exiftool I was using when I noticed this.  Either 4.26/8.74 or 4.21/8.63.

--peter

BogdanH

Hi peter,

In GUI, Autorotate works in two modes, where jhead.exe is used. That is, jpegtran.exe is called via jhead.exe (which simplifies the whole thing for GUI):

1. Preserve Date modified of files is checked
File Date modified becomes value from Exif DateTimes, regardless if rotation is actually needed/executed. To set Date modify according to Exif, GUI sends -ft command to jhead.exe. However, for jhead.exe, there's no option for "set only if actually rotated" and thus, all selected files are affected.
In first place, this mode is ment for those, who wish to keep Date modified values of files synchronized with Exif DateTime values all the time. Anyway, to avoid confusion, I will update GUI's warning message.

2. Preserve Date modified of files is unchecked
Here, file Date modified value changes only for those files, where rotation actually happens. In this case however, file Date modified becomes actual (today's) value.
I think, this is the mode you should use for Autorotate -because you said, you "maintain actual filesystem modify dates for images that I have post-processed manually".

Bogdan

pb

Quote from: BogdanH on December 31, 2011, 04:12:51 AM
Hi peter,

In GUI, Autorotate works in two modes, where jhead.exe is used. That is, jpegtran.exe is called via jhead.exe (which simplifies the whole thing for GUI):

1. Preserve Date modified of files is checked
File Date modified becomes value from Exif DateTimes, regardless if rotation is actually needed/executed. To set Date modify according to Exif, GUI sends -ft command to jhead.exe. However, for jhead.exe, there's no option for "set only if actually rotated" and thus, all selected files are affected.
In first place, this mode is ment for those, who wish to keep Date modified values of files synchronized with Exif DateTime values all the time. Anyway, to avoid confusion, I will update GUI's warning message.

2. Preserve Date modified of files is unchecked
Here, file Date modified value changes only for those files, where rotation actually happens. In this case however, file Date modified becomes actual (today's) value.
I think, this is the mode you should use for Autorotate -because you said, you "maintain actual filesystem modify dates for images that I have post-processed manually".

Bogdan

Thanks for clearing that up, and for expanding the warning.

Leaving 'preserve date' unchecked only solves half the problem -- the files that don't need rotation.  For files that do need rotation, I would not consider that post-processing any more than say changing a file name.  However, it can then be done with a two-step process, but that is rather tedious.  I guess what I want can be done with a fairly straightforward shell scipt using exiftool conditionals, but I will first have to be sure I understand all args to jpegtran/jpeghead and their behavior.