exifr icon indicating copy to clipboard operation
exifr copied to clipboard

Missing/wrong Rating meta?

Open KeyboardRage opened this issue 2 years ago • 2 comments

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

KeyboardRage avatar Dec 12 '22 16:12 KeyboardRage

@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
        };

grasdk avatar Feb 10 '24 09:02 grasdk

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

KeyboardRage avatar Feb 10 '24 17:02 KeyboardRage