Menu ▾ ▴

Exposure Compensation Getting Overwritten

7 days ago
3 days ago
  • Michael Long

    Michael Long - 7 days ago

    The exposure compensation value in EXIFIFD seems to get overwritten.

    Full disclosure, I am using exiftool from with an app (IMatch) but the developer is quite responsive and investigated this issue and can't see the problem on his side.

    Situation:

    1. I set my camera's exposure compensation to a fraction - eg. +2/3.
    2. It shows up in EXIFIFD correctly.
    3. I can't find any Maker's Notes tags for this value (Nikon)
    4. The app uses exiftool to synchronize XMP & EXIF, the XMP:Exif tag is showing +2
    5. Upon a writeback/update, the inconsistent values results in both the EXIF and XMP tags being +2

    Effectively, the correct value of +2/3 is lost.

    I really don't know if this is an exiftool issue or an application issue. The developer thinks it is exiftool, so I agreed to post here.

    I always appreciate the insight and knowledge from the exiftool gurus.

    Michael

     
  • StarGeek

    StarGeek - 7 days ago

    Can you share sample before and after files?

    Edit: Also, do you know the command the other program is running, or can you share the program's name?

     

    Last edit: StarGeek 7 days ago
  • Michael Long

    Michael Long - 5 days ago

    The program is IMatch. I had some back and forth with the developer on this topic. He didn't specify the API calls but I think this summarizes his thoughts.

    "IMatch does not modify native EXIF tags. IMatch synchronizes between XMP and EXIF using ExifTool, and ExifTool syncs EXIF into XMP EXIF and on write-back XMP EXIF into native EXIF."

    I took a picture this evening with +2/3 exposure compensation. I have attached the direct from camera picture and then the version that was indexed into IMatch and immediately written-back. Unfortunately, I didn't tone down the JPEG quality on my camera, so the files are large.

    I have also included the output that IMatch captures from the write-back using exiftool. Unfortunately, I don't think I can get the output from exiftool when the file is first indexed into IMatch.

     
  • Michael Long

    Michael Long - 5 days ago

    Hmm, maybe the files are too large. here is a zipped folder

     
  • StarGeek

    StarGeek - 5 days ago

    The text output is useful. There's nothing out of the ordinary because it's using the standard exiftool args files.

    A quick check shows using that exif2xmp.args file is copying the value correctly, but viewing XMP:ExposureCompensation without the -n option is only showing +2, even though the raw value with the -n option correctly shows +2/3.

    I copied ExposureCompensation from your file to my test file and here's the output when I look at my test file.

    C:\>exiftool -G1 -a -s -xmp:all y:\!temp\Test4.jpg  
    [XMP-x]         XMPToolkit                      : Image::ExifTool 13.00
    [XMP-exif]      ExposureCompensation            : +2
    
    C:\>exiftool -G1 -a -s -n -xmp:all y:\!temp\Test4.jpg  
    [XMP-x]         XMPToolkit                      : Image::ExifTool 13.00
    [XMP-exif]      ExposureCompensation            : +2/3
    

    A short term fix is to open up the
    C:\Program Files\photools.com\imatch6\arg_files\xmp2exif.args
    and change the last few lines from

    -GPS:GPSTimestamp < XMP-exif:GPSDateTime
    # end
    

    to

    -GPS:GPSTimestamp < XMP-exif:GPSDateTime
    -EXIF:ExposureCompensation<XMP-exif:ExposureCompensation#
    # end
    

    It's late for me, so I'll look into it further tomorrow.

     
  • Michael Long

    Michael Long - 5 days ago

    Thanks for the quick response.

    That is interesting about the Raw value. Sure enough, if I go into IMatch and use the Raw Value for the XMP tag it shows correctly at +2/3 for that file that has been indexed. However, the EXIF tag is still showing as +2.

    It is late for me as well, so I will make those changes tomorrow and trial it.

    Michael

     
  • StarGeek

    StarGeek - 4 days ago

    However, the EXIF tag is still showing as +2.

    Yes. Exiftool is displaying +2 instead of +2/3 when you look at the XMP-exif:ExposureCompensation tag. When IMatch copies the the value back to EXIF using the xmp2exif.args file, it is copying that value back to the EXIF and not the raw value.

    My patch to the args file forces exiftool to copy the raw value back instead of the displayed value.

    I'll have to do some more research later, but off hand, I'm inclined to think that this is a long standing bug, as I went as far back as exiftool version 12.00 and the behavior is the same.

    And a update as I'm typing this. The problem appears to be the plus sign +. If I set XMP-exif:ExposureCompensation to +2/3, then exiftool only displays +2 and +2/3 is the value saved in the raw XMP data. But if I set it to only 2/3, e.g.
    -xmp:ExposureCompensation=2/3
    then exiftool properly displays 2/3, and the xmp2exif.args command copies the correct value back to the EXIF:ExposureCompensation tag.

    Befcause of this, a patch to the exif2xmp.args file will fix the problem of the plus sign before it gets copied to the XMP tag. Edit the
    C:\Program Files\photools.com\imatch6\arg_files\exif2xmp.args
    file to add this line before the end:
    -XMP-exif:ExposureCompensation < EXIF:ExposureCompensation#

    This is the reverse of the patch to the xmp2exif.args file and makes sure the XMP-exif:ExposureCompensation tag doesn't include the plus sign.

     

    Last edit: StarGeek 3 days ago
  • StarGeek

    StarGeek - 4 days ago

    Further digging, the problem seems to be with the
    Image::ExifTool::Exif::PrintFraction()
    subroutine, as it doesn't handle a rational value with a plus sign.

    The problem might actually be further upstream from here as PrintFraction() is receiving a value of +2/3 when XMP-exif:ExposureCompensation has a value that includes the plus sign, but it receives a value of 0.666666666666667 when the tag doesn't include the plus sign.

    Beyond that, I've reached the limit of my understanding and it will be up to Phil to take a look at this.

    Now I have to re-download exiftool to fix all the edits I made to the files in trouble shooting this 😀

     
  • Phil Harvey

    Phil Harvey - 3 days ago

    Thanks StarGeek. Yes, this is a long-standing bug. A rational value in XMP should not have a leading "+" sign. I'll patch the code to remove the "+" when writing, and tolerate it when reading.

     

Log in to post a comment.