Question to XmpShorthand

Started by herb, April 13, 2018, 06:41:03 AM

Previous topic - Next topic

herb

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

Phil Harvey

#1
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.

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

herb

Hello Phil,

thanks for your detailed help.

Best regards
Herb