Forgive me, but I've been up all night and can't figure this out.
I have some jpg files which do not have any exif:DateTimeOriginal value (as shown by exiftool -s). My idea is to pick FileModifyDate and shove it into DateTimeOriginal.
My command:
exiftool -P -ext jpg -if "not $DateTimeOriginal" -d `"%Y:%m:%d %H:%M:%S"` -DateTimeOriginal=\"${FileModifyDate}\" Q*
My result:
Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in ExifIFD:DateTimeOriginal (PrintConvInv)
Nothing to do.
Altering the command in an attempt to print the operand:
exiftool -P -ext jpg -if "not $DateTimeOriginal" -d `"%Y:%m:%d %H:%M:%S"` -p -DateTimeOriginal=\"${FileModifyDate}\" Q*
My result:
-DateTimeOriginal="2013:12:17 06:56:48"
Help, please?
ExifTool uses the = operator for assigning simple values. To copy one tag to another, use < instead. See the Copying Examples (https://exiftool.org/exiftool_pod.html#copying_examples) section of the documentation (but note you must use double quotes instead of single quotes if you are in Windows).
- Phil
This works:
exiftool -P -ext jpg -if "not $DateTimeOriginal" "-DateTimeOriginal<FileModifyDate" Q*
Tried something similar earlier this AM, but redirection got me. Thanks for the reminder about the quotes.