Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing/wrong Rating meta? #100

Open
KeyboardRage opened this issue Dec 12, 2022 · 2 comments
Open

Missing/wrong Rating meta? #100

KeyboardRage opened this issue Dec 12, 2022 · 2 comments

Comments

@KeyboardRage
Copy link

I'm trying to use this tool to read ratings of images, but there seems to be a big discrepancy I can't figure out where different Exif readers and programs shows different results.

I've attached an image used for the following results:

  • Windows Explorer: 1
  • Adobe Bridge:
    • In UI: 2
    • In File Info -> Raw:
      • xmp:Rating: 2
      • MicrosoftPhoto:Rating: 1
  • Exiftool (program):
    • Rating: 2
    • Rating Percent: 1
  • Exif Data (online tool):
    • IFD0
      • Rating: 1
      • Rating Percent: 1
    • XMP -xmp
      • Rating: 2
    • XMP -microsoft
      • Rating: 1
  • exifr (Online):
    • IFD0
      • Rating: 1
      • Rating Percent: 1
    • XMP
      • Rating: 1
  • exifr (.parse(file, true) to JSON file):
    • Rating: 1
    • Rating Percent: 1

I am not quite sure which one to go with here, but there seem to be some information differences. I tested on a different computer for both Explorer and Adobe Bridge to try to rule out cache as much as possible, and there are no hidden sidecar files either.

Image used for these results

@grasdk
Copy link

grasdk commented Feb 10, 2024

@KeyboardRage - better late than never: The difference from the different programs comes from how they merge and prioritize overlapping tags from different exif sections. If you want full control, you should avoid merging.

  • With exiftool, this is done with the -a option and you display the group names with -G# (I used 0 and 1 below).
  • With exifr you set mergeOutput false

In your particular case, the answer lies in the fact that there is both an exif-ifd0 rating and an xmp rating:

$ exiftool 207094492-0a102e25-dcb5-4603-8123-f0e6304cdafb.jpg -rating* -g -a -s -G0:1
[EXIF:IFD0]     Rating                          : 1
[EXIF:IFD0]     RatingPercent                   : 1
[XMP:XMP-xmp]   Rating                          : 2
[XMP:XMP-microsoft] RatingPercent               : 1

With exifr, you get this (abbreviated by manually removing all non-rating data):

{
  "xmp": {
    "Rating": 2
  },
  "MicrosoftPhoto": {
    "Rating": 1
  },
  "ifd0": {
    "Rating": 1,
    "RatingPercent": 1
  }
}

These were my exifr options:

        const exifrOptions = {
            tiff: true,
            xmp: true,
            icc: false,
            jfif: false,
            ihdr: true,
            iptc: false,
            exif: true,
            gps: true,
            translateValues: false,
            mergeOutput: false //don't merge output, because things like Microsoft Rating (percent) and xmp.rating will be merged
        };

@KeyboardRage
Copy link
Author

@grasdk Hey, yes better than never 😄
Thank you so much for the clarification and examples. Today I learned something new!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants