Assume I modified a digital photo slightly.
Now I want to change the files last modified time (in Windows) back to the original time which can be retrieved from the EXIF header of the *.jpg.
How can I do this exactly?
I remember times when there was a menu in ExifTool GUI
Modify--->FileModifyDate as in ExifDateTimeOriginal
but it do not find it any more in newest ExifToolGUI software.
How does it work now?
Peter
Quote from: pstein on May 08, 2019, 10:33:22 AM
Now I want to change the files last modified time (in Windows) back to the original time which can be retrieved from the EXIF header of the *.jpg.
From the command line, you do this:
exiftool "-filemodifydate<datetimeoriginal" FILESorDIRSI can't help with the GUI though. My only idea would be to try "-filemodifydate<datetimeoriginal" in the ExifTool direct box (if memory serves).
- Phil
Thank you.
Actually I prefer a GUI to not have to remember always the exact cmdline syntax.
But it is welcomed as a second solution.
But two more question:
1.) When I apply your command to a folder which contains some *.jpg files with NO EXIF header
then exiftools starts, processes e.g. 34 photo files and aborts.
How can I tell exiftool to skip (silently) *.jpg files with NO EXIF header and automatically continue with the following?
2.) How does your command work recursively for a whole dir tree?
Peter
Quote from: pstein on May 09, 2019, 01:13:22 AM
1.) When I apply your command to a folder which contains some *.jpg files with NO EXIF header
then exiftools starts, processes e.g. 34 photo files and aborts.
Exiftool will still have to read those files to make the determination if there is data to be processed. If there isn't a
DateTimeOriginal tag in the file, nothing will actually happen with that file.
QuoteHow can I tell exiftool to skip (silently) *.jpg files with NO EXIF header and automatically continue with the following?
You could use
exiftool -if "$DateTimeOriginal" "-filemodifydate<DateTimeOriginal" FILESorDIRSThis will skip any file that doesn't have the
DateTimeOriginal tag. But in the case of this command, files without that value will be skipped anyway, so it's a bit redundant.
Though, I just realized that there might be other time tags in the file that are used to create the
Composite:DateTimeOriginal (IPTC date and time tags), as well as the possibility of the
XMP:DateTimeOriginal tag (though unlikely to exist if there isn't a
DateTimeOriginal in the EXIF block). To avoid writing in those cases, you can specify the group.
exiftool -if "$EXIF:DateTimeOriginal" "-filemodifydate<EXIF:DateTimeOriginal" FILESorDIRSQuote2.) How does your command work recursively for a whole dir tree?
Add the
-r option (https://exiftool.org/exiftool_pod.html#r-.--recurse) to your command. But take note that using a wildcard, such as *.jpg, will not work when you recurse. If you need to limit to certain files, such as jpgs, then you need to use the
-ext (extension) option (https://exiftool.org/exiftool_pod.html#ext-EXT---ext-EXT--extension), e.g.
-ext jpg