ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: jasonwehling on June 07, 2021, 08:13:30 PM

Title: Injecting XMP does not display in Apple Preview or Photoshop
Post by: jasonwehling on June 07, 2021, 08:13:30 PM
I'm injecting XMP ("inject.xmp") into a peculiar JPG ("Original.jpg"), this way:

exiftool -charset utf8 -m -overwrite_original -tagsfromfile inject.xmp -xmp original.jpg

Particularly, I'm injecting these XMP fields:


What's odd is that it works insofar as if I open the JPG (EmbeddedXMP.jpg) in vi, I can see the XMP block is there, with all the fields. However, in Apple Preview and Photoshop, only the xmpRights:UsageTerms field shows up (Attempt 1 Result.png).

Messing around, I tried clearing all the embedded metadata as part of the command, like this:

exiftool -All= -charset utf8 -m -overwrite_original -tagsfromfile inject.xmp -xmp original.jpg

And that works. Now I can see all the XMP fields that were injected in Apple Preview and Photoshop (Attempt 2 Result.png).

So what's the problem? I would prefer not to go nuclear and clear everything like that. I would prefer to simply inject the changed fields only, leaving anything else in the embedded metadata as-is.

Is there a way to accomplish this?

The referenced files (Original.jpg, inject.xmp, and the output: EmbeddedXMP.jpg) are available for download here:

https://library.netx.net/app/#share/request/3563c3c4-16dd-48d9-a1bb-9aabed09f436

System: replicatable on Mac and Linux.
ExifTool version: 12.23

Thanks!
Title: Re: Injecting XMP does not display in Apple Preview or Photoshop
Post by: Phil Harvey on June 08, 2021, 02:58:44 PM
See the 2nd-last paragraph in FAQ 3 (https://exiftool.org/faq.html#Q3).

- Phil
Title: Re: Injecting XMP does not display in Apple Preview or Photoshop
Post by: Phil Harvey on June 08, 2021, 03:47:38 PM
I think I'll add a Warning if the IPTCDigest is not current.  This should help in future cases like this.

- Phil
Title: Re: Injecting XMP does not display in Apple Preview or Photoshop
Post by: jasonwehling on June 08, 2021, 04:03:41 PM
Many thanks for your help on this! Yes, indeed, that IPTCDigest _is_ the problem. If I simply add "-IPTCDigest=" as an additional parameter, everything works as expects. Can I assume that simply clearing that hash (likely) won't cause other harm?
Title: Re: Injecting XMP does not display in Apple Preview or Photoshop
Post by: Phil Harvey on June 08, 2021, 08:29:02 PM
Correct.