ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: herb on June 24, 2016, 08:57:15 AM

Title: incorrect URI for xmlns:MicrosoftPhoto?
Post by: herb on June 24, 2016, 08:57:15 AM
Hello Phil,

during my tests of XnViewMP 0.80 I compared some xmp-tags written by XnViewMP and Exiftool 10.20.
I stored e.g.  xmp:rating and xmp-microsft:ratingpercent and compared the xmp part with an hex-editor.

Displaying metadata of a file written by XnViewMP with Exiftool I got the warning:
[minor] Fixed incorrect URI for xmlns:MicrosoftPhoto

The following is stored by XnView:
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.5.0">
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about=""
            xmlns:xmp="http://ns.adobe.com/xap/1.0/"
            xmlns:MicrosoftPhoto="http://ns.microsoft.com/photo/1.0/">
         <xmp:Rating>0</xmp:Rating>
         <MicrosoftPhoto:Rating>0</MicrosoftPhoto:Rating>
      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta>

The difference to data stored by Exiftool - as far as I have seen - is a slash at the end of URI xmlns:MicrosoftPhoto

This URI in Exiftool file XMP.pm line 138 is as follows:
MicrosoftPhoto => 'http://ns.microsoft.com/photo/1.0',

Could it be, that the slash is missing, because all other URI (except MP1) in file XMP.pm have it.

Best regards
Herb
Title: Re: incorrect URI for xmlns:MicrosoftPhoto?
Post by: Phil Harvey on June 24, 2016, 09:12:11 AM
Hi Herb,

At some point it seems that Microsoft changed their minds about the trailing "/".  You just can't change a URI after it has been defined.  But Microsoft isn't known for their consistency or conformance to published standards.

For forward compatibility ExifTool accepts the "/" but gives a warning.

- Phil
Title: Re: incorrect URI for xmlns:MicrosoftPhoto?
Post by: herb on June 24, 2016, 12:23:28 PM
Hello Phil,

thanks for your quick answer.

But it is strange for me, because the URI is listed with slash at the end on:
Microsoft MSDN:    https://msdn.microsoft.com/en-us/library/windows/desktop/ee719904%28v=vs.85%29.aspx
A.Huggel (Exiv2):  http://www.exiv2.org/tags-xmp-MicrosoftPhoto.html

Best regards
Herb
Title: Re: incorrect URI for xmlns:MicrosoftPhoto?
Post by: Phil Harvey on June 25, 2016, 07:53:11 AM
Yes, I saw those too.  But initially it had no trailing slash.  What version of Microsoft Photo do you have?  Did you try it to see what it writes?

- Phil
Title: Re: incorrect URI for xmlns:MicrosoftPhoto?
Post by: herb on June 26, 2016, 06:38:09 AM
Hello Phil,

I do not have Microsoft Photo.
I wrote metadata with XnViewMP.
Now I tried to repeat the test and in addition I wrote metadata with Daminion 4.5.

I suggest that both XnViewMP and Daminion use an Adobe toolkit, because both write an identical line:
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.5.0">

In Daminion file the URI is without slash at the end: xmlns:MicrosoftPhoto="http://ns.microsoft.com/photo/1.0"
In XnViewMP file I found: xmlns:MicrosoftPhoto_1_="http://ns.microsoft.com/photo/1.0/">
I my first post I talked about: xmlns:MicrosoftPhoto="http://ns.microsoft.com/photo/1.0/" not xmlns:MicrosoftPhoto_1_
but both have a slash at the end.

It sounds crazy, but I could not recreate a XnViewMP file with xmlns:MicrosoftPhoto="http://ns.microsoft.com/photo/1.0/".

As far as I know should xmlns:MicrosoftPhoto_1_ not exist, but it seems it does.
Am I right?

Please take this as information only.
It becomes more and more confusing.
Best regards
Herb
Title: Re: incorrect URI for xmlns:MicrosoftPhoto?
Post by: Phil Harvey on June 27, 2016, 07:58:42 AM
Hi Herb,

The namespace prefix MicrosoftPhoto_1_ is unfortunate, but is allowed.  It is the URI that is the important thing.  XNViewMP writes the URI with a trailing slash, which will generate a warning in ExifTool.   I googled to see if the trailing slash is significant, and apparently it is:

"The two namespaces having not equal-strings-uri's are different namespaces. Even capitalization and white-space matters." (from here (http://stackoverflow.com/questions/430990/what-is-the-significance-of-trailing-slashes-in-a-namespace-uri))

- Phil