XMP Rating, MS PhotoInfo & xmp2exif.args file mysteries

Started by Mac2, February 04, 2013, 09:40:11 AM

Previous topic - Next topic

Mac2

I have several files which were apparently touched by a Microsoft Product. The file contains XMP:rating and various rating percentages in EXIF and XMP as well.

When I update the rating in the file with

-use mwg -composite:rating=1

or

-usw mwg -xmp:rating=1

the new rating sticks. My application also translates the standard XMP:rating into the corresponding percentage ratings while writing. Some apps out there use the percentages, apparently. All nice and shiny.

But when I run the standard XMP2EXIF.args file to propagate changes made to XMP to EXIF for MWG compliance, the rating stored in the mysterious tag

XMP::other:MicrosoftPhoto_1_:Rating

apparently overrides the other tags in the file? The XMP / Composite ratings get values like 63 after running the ARGS file...?

I use

-use MWG -G  -X -D -t -q -q -l -m

to extract the data in XML format from the file, and there the strange XMP::other:MicrosoftPhoto_1_:Rating tag shows up.

You can use the sample DarwinCore JPEG file available here:

https://exiftool.org/forum/index.php?action=dlattach;topic=4442.0;attach=495

to see the effect and the various ratings in the file. It took me a while to figure out what the source of the problem was and why the ratings written by my application were replaced with strange data.

PS.: Thank you, Phil, for adding support for DarwinCore in the latest version. Works like a charm  :)


Phil Harvey

I noticed the MicrosoftPhoto problem in the DarwinCore sample.  I don't know what application wrote this XMP, but it is idiopathic in that it contains 2 different MicrosoftPhoto namespace prefixes to the same namespace, but the first URI is incorrect and contains a trailing "/" that it shouldn't.  Here is an excerpt from the XMP itself:

xmlns:MicrosoftPhoto_1_="http://ns.microsoft.com/photo/1.0/"
xmlns:MicrosoftPhoto="http://ns.microsoft.com/photo/1.0"


And 2 conflicting values of Rating for these:

MicrosoftPhoto_1_:Rating="63"
MicrosoftPhoto:Rating="75"


Very odd indeed.

Under normal circumstances, ExifTool will extract the MicrosoftPhoto Rating tag as "XMP-microsoft:RatingPercent", but in this case it doesn't quite know what to do with the other copy:

> exiftool ~/Desktop/DwC-SampleImage.jpg -G1 -a "-rating*"
[IFD0]          Rating                          : 4
[IFD0]          Rating Percent                  : 63
[XMP-MicrosoftPhoto_1_] Rating                  : 63
[XMP-microsoft] Rating Percent                  : 75


It looks like the 2nd version of the XMP Rating tag that is causing the problem.  Honestly, I'm really not sure if there is anything I can do in this case to help, because I really don't know how this conflicting XMP information should be handled.

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

Mac2

Hi, Phil

thanks for the detailed analysis  :)

My software has to deal with images from all kinds of sources, produced over the last 20 years and edited with a bazillion of different applications. Not every fringe case can be handled and I surely do not expect ExifTool to deal with these things. Sometimes nonsense is just nonsense and needs to be dealt with manually. I surely don't expect ExifTool to handle such cases, I just wondered. ExifTool does a lot already in the "silent cleanup and fixing of fuzzy metadata" as it is.

I will file this as a "invalid metadata" and tell the users to fix their files by removing the duplicate tag or re-writing the metadata.