ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: dm413 on April 03, 2020, 10:55:19 AM

Title: Setting IPTC:SpecialInstructions changes what is returned by MWG:CreateDate
Post by: dm413 on April 03, 2020, 10:55:19 AM
I have a file that has a XMP-xmp:CreateDate. That value is returned by both XMP-xmp:CreateDate and MWG:CreateDate. The SpecialInstructions tag is not (yet) set.

exiftool -G1 -XMP-xmp:CreateDate -MWG:CreateDate -IPTC:SpecialInstructions test2.jpg
[XMP-xmp]       Create Date                     : 2020:03:06 11:49:23-06:00
[MWG]           Create Date                     : 2020:03:06 11:49:23-06:00


I set the SpecialInstructions tag.

exiftool -IPTC:SpecialInstructions="My instructions" test2.jpg

I check the CreateDate again. The IPTC:CreateDate is unchanged, but the MWG:CreateDate returns empty.

exiftool -G1 -XMP-xmp:CreateDate -MWG:CreateDate -IPTC:SpecialInstructions test2.jpg
[XMP-xmp]       Create Date                     : 2020:03:06 11:49:23-06:00
[IPTC]          Special Instructions            : My instructions


What is going on here? I have looked at a dump of all tags, comparing before and after, and I don't see any reason for this behavior.

The same thing happens if I set other IPTC fields. For example, instead of setting IPTC:SpecialInstructions, I could set IPTC:Keywords. The MWG:CreateDate will now return empty. However, if I set MWG:Keywords, this does not happen and MWG:CreateDate will return the expected 2020 date.

So for keywords, as long as I consistently use MWG group, I am OK. But there is no MWG:SpecialInstructions, so how do I set IPTC:SpecialInstructions without effectively "erasing" my MWG:CreateDate.



Title: Re: Setting IPTC:SpecialInstructions changes what is returned by MWG:CreateDate
Post by: dm413 on April 03, 2020, 10:57:43 AM
Sorry, I forgot.
Exiftool 11.92
Windows 10 64-bit
Title: Re: Setting IPTC:SpecialInstructions changes what is returned by MWG:CreateDate
Post by: StarGeek on April 03, 2020, 11:07:56 AM
I can't replicate that here.  Copy/pasted your commands with a slight edit gave me
C:\>exiftool -G1 -XMP-xmp:CreateDate -MWG:CreateDate -IPTC:SpecialInstructions  y:\!temp\Test4.jpg
[XMP-xmp]       Create Date                     : 2020:04:03 08:02:55-07:00
[MWG]           Create Date                     : 2020:04:03 08:02:55-07:00

C:\>exiftool -P -overwrite_original  -IPTC:SpecialInstructions="My instructions" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -G1 -XMP-xmp:CreateDate -MWG:CreateDate -IPTC:SpecialInstructions y:\!temp\Test4.jpg
[XMP-xmp]       Create Date                     : 2020:04:03 08:02:55-07:00
[MWG]           Create Date                     : 2020:04:03 08:02:55-07:00
[IPTC]          Special Instructions            : My instructions
Title: Re: Setting IPTC:SpecialInstructions changes what is returned by MWG:CreateDate
Post by: dm413 on April 03, 2020, 11:26:26 AM
Did your original file also have other createdates set? Please try with a file which has only XMP-xmp:CreateDate and not EXIF:CreateDate.

You can download my original file here: https://www.dropbox.com/s/1rnccjz5qlrq1m4/Test2.jpg?dl=1 (https://www.dropbox.com/s/1rnccjz5qlrq1m4/Test2.jpg?dl=1)
Title: Re: Setting IPTC:SpecialInstructions changes what is returned by MWG:CreateDate
Post by: Phil Harvey on April 03, 2020, 12:16:32 PM
I haven't tried your example, but to keep the IPTC synchronized with the XMP you must update IPTCDigest when writing any IPTC tag.  ie)

exiftool -IPTC:SpecialInstructions="My instructions" -iptcdigest=new test2.jpg

This isn't necessary if they weren't previously synchronized.

- Phil
Title: Re: Setting IPTC:SpecialInstructions changes what is returned by MWG:CreateDate
Post by: dm413 on April 03, 2020, 12:32:20 PM
Yep, that fixes it. Thanks!

But why doesn't MWG:CreateDate return the XMP-xmp value even if the IPTCDigest is not updated? There is still a valid XMP-xmp:CreateDate, and no other CreateDate.

The docs say when reading, the value of each MWG tag is Derived From the specified tags based on the MWG guidelines. This leads me to think that this would happen whether things were in sync or not.
Title: Re: Setting IPTC:SpecialInstructions changes what is returned by MWG:CreateDate
Post by: Phil Harvey on April 03, 2020, 03:51:16 PM
Quote from: dm413 on April 03, 2020, 12:32:20 PM
But why doesn't MWG:CreateDate return the XMP-xmp value even if the IPTCDigest is not updated? There is still a valid XMP-xmp:CreateDate, and no other CreateDate.

I'm just theorizing here because I haven't read the MWG spec in some time, but...

Imagine that you delete CreateDate from IPTC without updating IPTCDigest.  Then the XMP would be out of sync, and to be safe a reader should ignore any CreateDate in the XMP.

- Phil