ExifTool Forum

ExifTool => Developers => Topic started by: herb on April 13, 2018, 06:41:03 AM

Title: Question to XmpShorthand
Post by: herb on April 13, 2018, 06:41:03 AM
Hello Phil,

my Windows application uses the commandline option -z in order to write an XMP block without padding.
Now I have learned that this might have a side-effect on *.png images, because compress is also set.
I think I will "-z" replace with "-api compact=1".

Reading the help information I also found the option XmpShorthand. But this is totally unclear to me.

Now I have 2 questions:
- Is "compress" only valid for *.png images?
- What is "XmpShorthand" for?.

Thanks for your help in advance.

Best regards
Herb
Title: Re: Question to XmpShorthand
Post by: Phil Harvey on April 13, 2018, 07:14:38 AM
Hi Herb,

Photoshop is now writing shorthand XMP, so it should be safe to use this format.

Here is an illustration of the difference:

% exiftool -artist=phil -o -.xmp
<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 10.93'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>

<rdf:Description rdf:about=''
  xmlns:tiff='http://ns.adobe.com/tiff/1.0/'>
  <tiff:Artist>phil</tiff:Artist>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end='w'?>

% exiftool -artist=phil -o -.xmp -api xmpshorthand
<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 10.93'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>

<rdf:Description rdf:about=''
  xmlns:tiff='http://ns.adobe.com/tiff/1.0/'
  tiff:Artist='phil'/>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end='w'?>


The Compress option is currently used for PNG and MIE format.  Read here for details on the effects of the Compress option on PNG tags (https://exiftool.org/TagNames/PNG.html#TextualData).

- Phil

Edit: I just realized that setting the Compact option to 1 has no effect on XMP in PNG images anyway.  No padding is written in PNG by default because the XMP is not writable in place due to the PNG checksum feature.  This isn't mentioned in the documentation.
Title: Re: Question to XmpShorthand
Post by: herb on April 13, 2018, 10:11:42 AM
Hello Phil,

thanks for your detailed help.

Best regards
Herb