When DateTimeOriginal is absent...

Started by marciano, January 30, 2019, 03:34:06 PM

Previous topic - Next topic

marciano

I have some photos which lack Date Time Original metadata. 
exiftool -FileModifyDate /path-to/IMG.jpg
File Modification Date/Time     : 2017:12:22 18:12:27-03:00    (example)
that seems it is the original date despite their tag name
I want to add this date to DateTimeOriginal so I run
exiftool -DateTimeOriginal=FileModifyDate /path-to/IMG.jpg 
Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in ExifIFD:DateTimeOriginal (PrintConvInv)
What am I missing?
Thank you

StarGeek

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

marciano

Hi.
Mac 10.14. ET ver 11.23
I already had used "<" instead of "=" before posting but the source tag is treated as a file
-bash: FileModifyDate: No such file or directory

StarGeek

See 4th paragraph under the -TagsFromFile option

    Note that this argument must be quoted to prevent shell redirection,

So try
exiftool "-DateTimeOriginal<FileModifyDate" /path-to/IMG.jpg
if on windows, or
exiftool '-DateTimeOriginal<FileModifyDate' /path-to/IMG.jpg
if on mac/linux
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

marciano

Thanks for your quick reply.
I have a list of commands I tried and one of them was (I copy-paste from Mac TextEdit)
exiftool '-DateTimeOriginal<FileModifydate' ...
that didn't work.
Now I copy-paste your command
exiftool '-DateTimeOriginal<FileModifyDate' /path-to/IMG.jpg
1 image files updated
and it does the job.
I see both single quotes are not the same in my textarea while writing this post, also noticed in Preview
I use single quotes all the time.
I attached two screenshots of my text area.
Thank you

StarGeek

Word processors and things like Google docs will "help" you out by replacing regular single/double quotes with fancy or smart quotes.  There's also a setting on the Mac to do this, apparently universally.  Take a look at this Superuser answer for more info.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).