Setting IPTC:SpecialInstructions changes what is returned by MWG:CreateDate

Started by dm413, April 03, 2020, 10:55:19 AM

Previous topic - Next topic

dm413

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.




dm413


StarGeek

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
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

dm413

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

Phil Harvey

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

dm413

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.

Phil Harvey

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