incorrect URI for xmlns:MicrosoftPhoto?

Started by herb, June 24, 2016, 08:57:15 AM

Previous topic - Next topic

herb

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

Phil Harvey

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

Phil Harvey

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
...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,

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

Phil Harvey

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)

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