Can I modify the EXIF 'Date Aquired' based on the file system date?

Started by BrettS, July 07, 2014, 07:50:53 AM

Previous topic - Next topic

BrettS

From the searches I've done, this seems to be the opposite of what everyone else wants to do, but I'm wondering if it's possible to modify the EXIF 'Date Aquired' based on the file system date. 

It's kind of a long story, but I exported the entire photo library from my iPhone (around 10,000 images) using the photo import tool in Windows.  While the vast majority of the images have correct dates in their EXIF data there are some images (things like screen shots and images downloaded from facebook and web pages and email and such where the EXIF data was stripped) that do not.  For some reason the iPhone always sorted these images based on the day the screen shots were taken or the images were downloaded, but whatever it was using to do so didn't come across with the import.  Now all of those images (maybe 5% of the total) all have the date of the import listed as the "Date Acquired", but for some reason the file system date is correctly showing the date the screen shots were taken or the images were downloaded. 

So, I'd like to use ExifTool (or something else) to process through those images and correct the EXIF data.  Is this possible?

Also, ideally I'd like to avoid touching all 10,000 images, but I'm not sure the best way to sort out only the ones I need.  Can I use ExifTool to identify or pull out only the images with a "Date Aquired" of the date I did the import?  Of course this will still pull a few images that should legitimately have that date, but it will just be a handful and then I won't have to modify all 10,000 images.  (Frankly, though, modifying all 10,000 images wouldn't be the end of the world as the file system date does appear to be correct for all of the images anyway, but still, I prefer not to modify files when I don't absolutely need to)

Thanks much,
Brett

Phil Harvey

Hi Brett,

You may copy an ExifTool tag to any other.  So copying FileModifyDate to EXIF:DateTimeOriginal is easy.

If you want to only copy the ones where the time is different, it may be a little trickier because the FileModifyDate has a time zone and the EXIF date/time doesn't.  But I think adding an -if like this may do it:

exiftool -if "$datetimeoriginal ne ${filemodifydate;s/[-+].*//}" "-datetimeoriginal<filemodifydate" DIR

But I don't have time to test this right now, so I can't be sure I haven't made a mistake.

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