Update the missing EXIF only

Started by satsat, July 02, 2015, 08:04:48 AM

Previous topic - Next topic

satsat

Hi,

I have a bunch of images and some of them (arround 10%= doesn't have a valid DateTImeOriginal EXIF date, so I want to fix them, you would normally say:

exiftool -v "-FileModifyDate>DateTimeOriginal" *

But I want the command to affect only to the images that are missing the DateTimeOriginal EXIF date, I don't want ALL the images to have their DateTimeOriginal EXIF date replaced by their FileModifyDate.

Can this be done?.

Thanks. Jordi.

Phil Harvey

Hi Jordi,

The -wm (WriteMode) option gives you full control over this.  Adding -wm cg to your command disables writing to existing tags.

Alternatively, -if "not $datetimeoriginal" may be added, but this is less efficient because it requires an additional read of metadata from the file.

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

satsat