News:

2023-08-10 - ExifTool version 12.65 released

Main Menu

Use if to write to label

Started by Whaler, October 25, 2018, 11:49:31 AM

Previous topic - Next topic

Whaler

My apologies in advance for what is probably a simple problem.
I have thousands of photos that have inconsistent time stamps that I would like to resolve. I have been successful at changing the incorrect time stamps as I find them but am looking for a way to mark the files that need correction.
I had hoped to compare the [XMP-exif] Date/Time Digitized with the [XMP-photoshop] Date Created and if they don't match to set the [XMP-xmp] Label to read "Wrong Time Stamp"

I have tried several variations of the following line:

-label=Wrong Time Stamp -if "$datecreated ne $datetimedigitized"
Unfortunately everything I've tried writes to the label even when the two time stamps do match.

Any help would be greatly appreciated.

StarGeek

Can you provide an example file where this doesn't work?

Using -if "$DateCreated ne $DateTimeDigitized" works in my tests, so there's something else going on here.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Whaler

I am trying to attach the photo, I had to resize it because of a time out or size issue warning but after resizing I get the following message:
"Your attachment has failed security checks and cannot be uploaded. Please consult the forum administrator"

Whaler


StarGeek

The problem is that this image also has an IPTC:DateCreated tag which is taking priority over the XMP:DateCreated  The IPTC tag is only the date (2018:04:21).  This is normal as the IPTC:DateCreated is defined as only holding the date value.  The XMP:DateCreated includes the time and time zone (2018:04:21 06:47:01-07:00).  So obviously, "2018:04:21" is not equal to "2018:04:21 06:47:01-07:00". 

Change your command to -if "$XMP:DateCreated ne $XMP:DateTimeDigitized" and it should work as you want.

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Whaler

Thanks StarGeek, that worked.
Much appreciated.