Set missing DateTimeOriginal tag based on nearest photo in index

Started by toomanyphotos, December 12, 2015, 03:45:45 PM

Previous topic - Next topic

toomanyphotos

I leverage ExifTool to rename and organize photos I offload from several cameras and phones into a large shared library for my family.  The images are organized by date using DateTimeOriginal.

When processing images from iPhones several are typically missing DateTimeOriginal.  They often appear to be photos captured within iMessage and iPhone screenshots.  The file create and modification times are not typically an accurate substitute.  I set the DateTimeOriginal tag to the date of the nearest photo in the index of photos offloaded.

For example:

IMG_1001.JPG
IMG_1002.JPG
IMG_1003.JPG - missing DateTimeOriginal, set to Date from DateTimeOriginal in IMG_1002.JPG
IMG_1004.JPG - missing DateTimeOriginal, set to Date from DateTimeOriginal in IMG_1002.JPG

I wrote a script to automate the tagging process, but wonder if there is a more elegant solution available directly within ExifTool.

Phil Harvey

Exiftool deals with individual files and copying metadata between files, and there is no special logic to do exactly what you are asking.

- 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 ($).

toomanyphotos

Thanks for confirming I am not overlooking an ExifTool feature.  Over the years I've dropped most of the code from my original scripts in favor of more complex ExifTool commands.  Now I know some of my clunky code is worth retaining :)

Thanks for the excellent software!