ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: phc9 on May 30, 2015, 04:11:09 PM

Title: xmp-xmp rating tag
Post by: phc9 on May 30, 2015, 04:11:09 PM
Hi,

Sorry if this has been asked before, I have searched but nothing came up. I've been (very) happily using exiftool 8.93 and recently tried to upgrade to 9.96. In 8.93, I can extract a rating tag (that Win7 recognizes and shows as a number of stars in explorer):
"
D:\Users\Public\PicArchive\2015\05\105_0305>exiftool -rating imgp8349.jpg
Rating                          : 2
"
..but with 9.96 (and 9.90) this isn't found, the same command gives no output (note I've got exiftool (8.93) and exiftool-new (9.96) on my Windows path):
"
D:\Users\Public\PicArchive\2015\05\105_0305>exiftool-new -rating imgp8349.jpg
"
However, 9.96 does find it when given -xmp -b options, as shown below (see the last section). Is this something my rating s/w is getting wrong (despite exiftool 8.93 and Win7 recognizing it)? From comments about xmp:xap, I wonder if this is a namespace issue?
"
D:\Users\Public\PicArchive\2015\05\105_0305>exiftool-new -xmp -b imgp8349.jpg
<?xpacket begin='´╗┐' id='W5M0MpCehiHzreSzNTczkc9d'?>
<xmp:xmpmeta xmlns:xmp="adobe:ns:meta/">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b" xmlns:d
c="http://purl.org/dc/elements/1.1/">
   <dc:creator>
    <rdf:Seq xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
     <rdf:li>phc</rdf:li>
    </rdf:Seq>
   </dc:creator>
   <dc:subject>
    <rdf:Bag xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
     <rdf:li>tamron-di_sp:f2.8:70-200mm</rdf:li>
     <rdf:li>chris</rdf:li>
     <rdf:li>sam</rdf:li>
     <rdf:li>friends</rdf:li>
     <rdf:li>wheels</rdf:li>
    </rdf:Bag>
   </dc:subject>
   <dc:title>
    <rdf:Alt xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
     <rdf:li xml:lang="x-default">tour de yorkshire</rdf:li>
    </rdf:Alt>
   </dc:title>
  </rdf:Description>
  <rdf:Description rdf:about="uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b" xmlns:e
xif="http://ns.adobe.com/exif/1.0/">
   <exif:GPSAltitude>0</exif:GPSAltitude>
   <exif:GPSAltitudeRef>0</exif:GPSAltitudeRef>
   <exif:GPSLatitude>053,55.03306965996N</exif:GPSLatitude>
   <exif:GPSLongitude>001,55.9876227378846W</exif:GPSLongitude>
  </rdf:Description>
  <rdf:Description rdf:about="uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b" xmlns:t
iff="http://ns.adobe.com/tiff/1.0/">
   <tiff:Artist>phc</tiff:Artist>
  </rdf:Description>
  <rdf:Description rdf:about="uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b" xmlns:x
mp="http://ns.adobe.com/xap/1.0/">
   <xmp:CreatorTool>FotoTime FotoAlbum Pro</xmp:CreatorTool>
   <xmp:MetadataDate>2015-05-26T16:17:26+01:00</xmp:MetadataDate>
   <xmp:ModifyDate>2015-05-26T16:17:26+01:00</xmp:ModifyDate>
   <xmp:Rating>2</xmp:Rating>
  </rdf:Description>
</rdf:RDF>
</xmp:xmpmeta>
<?xpacket end='w'?>
"

thanks in advance...
Title: Re: xmp-xmp rating tag
Post by: Phil Harvey on May 31, 2015, 08:27:34 AM
Thanks for this report, and for the sample XMP.

Do you know what software wrote this XMP?

The problem is that that the "xmp" namespace prefix is defined with conflicting namespaces in this XMP:

xmlns:xmp="adobe:ns:meta/"

and later, the "xmp" namespace prefix is defined again:

xmlns:xmp="http://ns.adobe.com/xap/1.0/"

ExifTool 9.75 and later pays closer attention to the namespaces used in order to avoid problems with non-standard namespace prefixes, which is why it now has trouble with the conflicting namespace definition.

I'll see what I can do about this.  ExifTool should at least be issuing a warning here.

- Phil
Title: Re: xmp-xmp rating tag
Post by: phc9 on May 31, 2015, 09:45:55 AM
Thanks.

The original photos & their metadata are from a Pentax K-3. I then use exiftool to add a keyword corresponding to the lens (I do some lookups to disambiguate using focal length etc) and then the rating etc is added by FotoAlbum. The FotoTime support team are generally really helpful, I'll point them at this thread.

I guess the correct thing for me to do is to work out how to re-write the tags with the right namespaces using exiftool to fix-up all the existing 'bad' pictures.
Title: Re: xmp-xmp rating tag
Post by: Phil Harvey on May 31, 2015, 03:12:50 PM
I have added a patch to ExifTool that will fix this.  It will appear in version 9.97.  Writing the XMP with this version will resolve the conflict without ignoring the Rating (and other "xmp"-namespace tags).

When you mention this to the FotoAlbum people, tell them that the XMP should be contained within an "x:xmpmeta", not an "xmp:xmpmeta" wrapper.

I plan to do some research to see if it is actually valid to use the same namespace prefix for different namespaces like this.  It is possible this is legal, but I certainly wouldn't recommend it.

- Phil
Title: Re: xmp-xmp rating tag
Post by: phc9 on May 31, 2015, 04:23:43 PM
That's great... thanks and yes, they will see your post.
Title: Re: xmp-xmp rating tag
Post by: Phil Harvey on June 01, 2015, 07:50:38 AM
I checked the XML 1.0 specification:

The scope of a namespace declaration declaring a prefix extends from the beginning of the start-tag in which it appears to the end of the corresponding end-tag, excluding the scope of any inner declarations with the same NSAttName part.

So unfortunately this seems to be legal XML.  (I think that the NSAttName part they refer to is the namespace prefix, so inner declarations using the same prefix are allowed.)  I'll see what I can do to support this properly.

- Phil
Title: Re: xmp-xmp rating tag
Post by: Phil Harvey on June 02, 2015, 08:51:37 AM
I have just released version 9.97, which should hopefully resolve this issue.

Thanks for bringing this to my attention.

Please let me know if you have any more problems.

- Phil
Title: Re: xmp-xmp rating tag
Post by: phc9 on June 03, 2015, 05:53:21 AM
Thanks for the quick fix - great tool, great response. I've given it a quick go and it seems to work well.