Hi,
Firstly thanks for this awesome tool :)
So, for some reason I've got a bunch of files which were created with an invalid date.
The warning is:
`Warning: Month '00' out of range 1..12 in ExifIFD:DateTimeOriginal (PrintConvInv) - IMG_5342.jpeg`
Basically, I would like to check for those files that:
IF `EXIF:DateTimeOriginal` then it should re-write the `DateTimeOriginal` with the `FileModifyDate`.
I tried this:
`exiftool '-FileModifyDate<EXIF:DateTimeOriginal' -if "$warning" DIR`
But it tells me:
`1 files failed condition`
How can I correctly write the new DateTimeOriginal IF a warning appears? Thanks
You can check for a month of "00" like this:
exiftool -if "$exif:datetimeoriginal =~ /^....:00/" "-datetimeoriginal<filemodifydate" DIR
- Phil
Thanks Phil, but that example still tells me:
`1 files failed condition`
Thanks, it worked (single quotes, I'm on a Mac)
Is there a way it can check for just the warning? As I dont know it will always be '00'
Also, can it maintain the DateModified/Created from the original?
There is no easy way to just check for the warning. Plus, there are many other different warnings which may occur.
Add -P to preserve the original modification date. And to also preserve the original creation date on Mac, copy back FileCreateDate, like this:
exiftool -if '$exif:datetimeoriginal =~ /^....:00/' '-datetimeoriginal<filemodifydate' -P -filecreatedate DIR
But this requires that you have the "setfile" utility installed. If you don't, you can install it by with this command:
xcode-select --install
See FileCreateDate in the Extra Tags documentation (http://exiftool.org/TagNames/Extra.html) for the documentation on this.
- Phil