Assign a value to DateTimeOriginal

Started by HiTechHiTouch, December 17, 2013, 08:09:16 AM

Previous topic - Next topic

HiTechHiTouch

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?

Phil Harvey

ExifTool uses the = operator for assigning simple values.  To copy one tag to another, use < instead.  See the Copying Examples section of the documentation (but note you must use double quotes instead of single quotes if you are in Windows).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

HiTechHiTouch

#2
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.