Author Topic: set date based on best available information  (Read 162 times)

agrefrath

  • Newbie
  • *
  • Posts: 2
set date based on best available information
« 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!!!

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2514
Re: set date based on best available information
« Reply #1 on: December 30, 2018, 12:24:14 PM »
Try the -wm (writemode) option, specifically, -wm cg.  That will "Create new tags" but not "Write existing tags".
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

agrefrath

  • Newbie
  • *
  • Posts: 2
Re: set date based on best available information
« Reply #2 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.

Code: [Select]
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.