Inconsistent XMP reads
|Status:||Rejected||Start date:||30 Nov 2010|
A JPEG image contains - among others - the following metadata tags (command line utility exiv2-0.20, option -pa):
Iptc.Application2.Copyright String 14 ||ABC 123.00||
Xmp.dc.rights LangAlt 1 lang="x-default" Hans Muster
When extracting XMP data from this image, results are inconsistent:
A. option -ex -> image.exv:
<rdf:li xml:lang="x-default">Hans Muster</rdf:li>
B. option -eX -> image.xmp:
<rdf:li xml:lang="x-default">||ABC 123.00||</rdf:li>
From my opinion A. shows correct behaviour, B. is considered a bug.
According to the IPTC4XMPCore spec IPTC CopyrightNotice (2:116) should be kept in sync with Xmp.dc.rights, but should dc.rights be overwritten from IPTC, if they are out of sync as in this case?
And why is the output different beween options -ex and -eX?
Any info whether this should actually be considered a bug and if yes, where to start de-bugging is greatly appreciated. Could the XMPSDK be the culprit ...?
A test image may be provided, but has to be constructed from scratch since the original is copyrighted material.
#1 Updated by Andreas Huggel almost 8 years ago
- -ex extracts only XMP data whereas -eX extracts all metadata.
- Reading/writing XMP sidecars automatically invokes conversions from XMP to IPTC and Exif and vice versa. It's the only format for which metadata conversions are automatically applied.
For 1. the corresponding flags are:
- To extract only XMP data: -ex and -exX
- To extract all metadata:
exiv2 extract img.jpg and exiv2 -eX img.jpg
which is equivalent to
exiv2 -ea img.jpg and exiv2 -eaX img.jpg
For 2. the conversions apparently give the IPTC copyright higher precedence (-eaX results in an XMP with the IPTC copyright in the XMP dc:rights property). I'm not sure if that's correct. It should be defined in the XMP specs or the guidelines from the Metadata Working Group. There are existing bugs/discussions about the Exiv2 metadata conversions, in particular #601, but it is an area that has been dormant for quite a while.
If you want to look this up in the code, see XmpSidecar::readMetadata and XmpSidecar::writeMetadata in xmpsidecar.cpp and note the calls of the various copy*To*() functions. These and all conversion logic are in convert.cpp.