Rating and Rating, and Rating...?

Started by Mac2, September 11, 2011, 01:33:13 PM

Previous topic - Next topic

Mac2

Today I've ran into a case where a file had both an exif:Rating and an XMP:rating. These were different.
Depending on which application I use with these files, the one or other rating was displayed. I used Bridge, LR, Nikon Capture, Windows Exploder and some others. There is also a RatingPercent in some files. I think it is MS-specific.

I think that, to be on the safe side, I should check for these ratings and either remove them or set them to the same rating I set for xmp:rating.
The MWG has apparently no rule for this and the XMP2Exif.args file does not touch this tag either.

I think something like this

-exif:Rating < xmp:rating -if $exif:Rating
-exif:RatingPercent < xmp:rating -if $exif:RatingPercent

should do (arg file syntax)
Does anybody have experience with this or is there a "right" way to do it?

BogdanH

Hi,
Phil would know more about usage of Rating in Exif. But from my experience, "everybody" (Adobe, Canon,..) uses Xmp:Rating. That is, I never noticed there's Rating in Exif.

Bogdan

Phil Harvey

Neither of the EXIF Rating tags are standard EXIF, hence they aren't covered by MWG or handled by XMP2EXIF.args.

I'm not sure that simply copying them will work either, because the ranges are probably different (although I can't check now).  Certainly this is the case for RatingPercent at least.  You would need to create a user-defined tag to do the necessary conversion if you wanted to do this.

- 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

I checked this in detail with Windows Explorer 7.

If you change the rating of a file in Windows Explorer on Windows 7, the existing EXIF:rating is removed and instead an XMP rating is added.
XMP:rating and XMP-microsoft:Rating Percent are set as follows:

Rating / Rating Percent
1 / 1
2 / 25
3 / 50
4 / 75
5 / 99

you cannot reject (-1) a file in Windows Explorer.

If you modify the rating for such a file in, for example, Adobe Bridge, the xmp-microsoft:RatingPercent rating is removed.. An existing EXIF:rating is not touched. So, Microsoft removes the EXIF:rating. Adobe removes the xmp:RatingPercent.

Nice. And so predictable. I guess I can do what I want and still be as good as the big vendors.








Mac2

In conclusion, is is better to delete an existing exif:Rating from the file when you set a xmp:Rating.

If you use the exif2xmp.args files (like I do) to fill XMP from EXIF, the existing XMP rating is overwritten otherwise.

Phil Harvey

Quote from: Mac2 on September 15, 2011, 12:05:54 PM
In conclusion, is is better to delete an existing exif:Rating from the file when you set a xmp:Rating.

If you use the exif2xmp.args files (like I do) to fill XMP from EXIF, the existing XMP rating is overwritten otherwise.

So just setting EXIF:Rating to the same value when you write XMP:Rating doesn't do what you want?  I don't know if we have established that the ranges of the values in these tags is different or not.

Also, I was wrong about the Rating tag not being covered by xmp2exif.args:  Any same-named tag is copied, regardless of whether or not it is part of the standard (because the first argument in the file is -EXIF:all<XMP:all).

- 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

QuoteI don't know if we have established that the ranges of the values in these tags is different or not.
I could not find something definite about the EXIF:rating. Only that it is used by some applications, e.g. Windows Explorer - in older Windows versions. The Explorer in Windows Vista and Windows 7 uses XMP, and delete an existing EXIF:rating silently. And keeps RatingPercent in synch with the XMP:rating as outlined in my previous post.

QuoteAny same-named tag is copied, (...)
Yeah, I figured that out too.

The problem is that I run EIXF2XMP to update XMP from changes made to EXIF data. In this case the "correct" XMP rating is replaced with the outdated EXIF rating before I ingest the information into the database. But when I don't run the args file I risk that XMP and EXIF become separate which is no good.
And I want to use the args instead of implementing all the logic myself because this keeps ExifTool in control of the mapping process.

There is of course no optimal solution for this. My application has to handle image files written and updated with a wide variety of applications and services. Some images are over 10 years old and others come fresh from Lightroom, Capture, Aperture or an agency web site.

Since my application also allows the user to update EXIF, XMP, and IPTC, I have to get the mapping as good as possible. Always in favor of XMP as the most universal metadata format.
But if a user changes EXIF and XMP in one write operation, I cannot tell if I should run EXIF2XMP or XMP2EXIF first. Some data may be lost in both cases. Since I favor XMP, I run XMP2EXIF.args first, to synch XMP->EXIF. And then the other args file for the reverse synchronization. I consider the args files as opaque and make no assumptions about whether or not both args files must be run. I do the same for IPTC, GPS and PDF, depending on the file format and the data that was changed by the user.

Phil Harvey

#7
For what it's worth, the MWG recommends prioritizing EXIF over XMP, although they don't have a recommendation regarding the Rating tag, but I'm sure you don't want to hear this. :P

But I do have a suggestion which may be useful.  Instead of deleting EXIF:Rating before copying EXIF to XMP, you could simply exclude Rating from the copy, like this:

exiftool -@ exif2xmp.args --rating ...

- 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 tip!

I'm only half-way through the MWG document at the moment. Strange, I would have thought they favor XMP over EXIF. Well, anyway.
I've talked to some of my users, and they want an option (should be #9209 then) to control this. Because they have to deal with such a mix of images from so many sources, one just cannot assume what rating (if any) is the more "important" one.  ::)

If I can override statements in the args files like you outlined, I have a way to to implement conditional behavior  :)
I put that on my to-do list for this weekend. Eh. Or beginning next week....