ExifTool Forum

ExifTool => Newbies => Topic started by: agrefrath on December 30, 2018, 10:22:42 AM

Title: set date based on best available information
Post by: agrefrath on December 30, 2018, 10:22:42 AM
I want to set replace an empty value for the EXIF creation-Date by the file creation date and I am not successful to find out how.

exiftool "-datetimeoriginal<filemodifydate" *   

obviously does the job for ALL files; but how can I modify the command to only change the date for the pictures, which have NO EXIF information on the date?

Many thanks for your support!!!
Title: Re: set date based on best available information
Post by: StarGeek on December 30, 2018, 12:24:14 PM
Try the -wm (writemode) option (https://exiftool.org/exiftool_pod.html#wm-MODE--writeMode), specifically, -wm cg.  That will "Create new tags" but not "Write existing tags".
Title: Re: set date based on best available information
Post by: agrefrath on December 31, 2018, 12:07:17 PM
wow! many thank. Clear and crisp answer, which solves the topic. I really do appreciate your help.

exiftool -r -wm cg "-datetimeoriginal<filemodifydate" *

solves my issue (check every file of the whole underlying structure and set the EXIF Date to the Filesystems Datestamp, if (and only if) the EXIF Date is empty.) That seems to me the best educated guess on the particular photo's date.