ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: satsat on July 02, 2015, 08:04:48 AM

Title: Update the missing EXIF only
Post by: satsat on July 02, 2015, 08:04:48 AM
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.
Title: Re: Update the missing EXIF only
Post by: Phil Harvey on July 02, 2015, 09:19:59 AM
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
Title: Re: Update the missing EXIF only
Post by: satsat on July 02, 2015, 09:51:53 AM
Thanks a lot PHil, I'll try it!