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:
I set my camera's exposure compensation to a fraction - eg. +2/3.
It shows up in EXIFIFD correctly.
I can't find any Maker's Notes tags for this value (Nikon)
The app uses exiftool to synchronize XMP & EXIF, the XMP:Exif tag is showing +2
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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.
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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 😀
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
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
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
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.
Hmm, maybe the files are too large. here is a zipped folder
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.argsfile is copying the value correctly, but viewingXMP:ExposureCompensationwithout the-noption is only showing +2, even though the raw value with the-noption correctly shows +2/3.I copied
ExposureCompensationfrom your file to my test file and here's the output when I look at my test file.A short term fix is to open up the
C:\Program Files\photools.com\imatch6\arg_files\xmp2exif.argsand change the last few lines from
to
It's late for me, so I'll look into it further tomorrow.
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
Yes. Exiftool is displaying
+2instead of+2/3when you look at theXMP-exif:ExposureCompensationtag. When IMatch copies the the value back to EXIF using thexmp2exif.argsfile, 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 setXMP-exif:ExposureCompensationto+2/3, then exiftool only displays+2and+2/3is the value saved in the raw XMP data. But if I set it to only2/3, e.g.-xmp:ExposureCompensation=2/3then exiftool properly displays
2/3, and thexmp2exif.argscommand copies the correct value back to theEXIF:ExposureCompensationtag.Befcause of this, a patch to the
exif2xmp.argsfile will fix the problem of the plus sign before it gets copied to the XMP tag. Edit theC:\Program Files\photools.com\imatch6\arg_files\exif2xmp.argsfile to add this line before the end:
-XMP-exif:ExposureCompensation < EXIF:ExposureCompensation#This is the reverse of the patch to the
xmp2exif.argsfile and makes sure theXMP-exif:ExposureCompensationtag doesn't include the plus sign.Last edit: StarGeek 3 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/3whenXMP-exif:ExposureCompensationhas a value that includes the plus sign, but it receives a value of0.666666666666667when 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 😀
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.