-
Notifications
You must be signed in to change notification settings - Fork 281
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
Serial number reported in easy access function appears to be incorrect #2792
Comments
The correct serial number is "2171204312" and is located in the key "Exif.Canon.SerialNumber" not the key "Exif.Photo.BodySerialNumber" which is examined first. Also, |
This case shows the limitations of easyaccess. The logic is to check several tags and the value of the first filled is returned. Unfortunately, the first hit has wrong data - which in general is impossible to detect. So I think, we cannot do something here. It is strange, that in this case print (gives interpreted value) and toString (gives original value) are different, because the type of Exif.Canon.SerialNumber is Long. In the code I can see, that print uses for this tag some special logic, so there must be a reason for it. Do you have access to the hardware to see, which of the two numbers is correct? |
Why not put Exif.Photo.BodySerialNumber last in the search list? If a serial number specific to a vendor is found, it will be returned first. I do not have the camera anymore. I do have other examples that do the same thing, though. |
I will check the impact to put Exif.Photo.BodySerialNumber last in the search list. It might happen, that we then have other wrong results. Will not be easy to judge what is correct, if changing sequence gives other results for other images. In most cases easy access first looks for Exif.Photo or Exif.Image, but there are also cases, where maker tags are first in list. For me it is plausible to start with Exif.Photo and Exif.Image, because these tags are well defined in a standard. So we know, what we can expect. An other argument - which would fit to your example - could be, that manufacturers take more care to fill their own tags than filling standard tags. Regarding the different result of print and toString: I opened your image with Canon Digital Photo Professional and the serial number shown there is the one exiv2 returns with toString. I checked some other images in my collection of test images and the result is the same. So either the conversion in print is wrong or the conversion is missing in Canon Digital Photo Professional. The history in GitHub shows, that this conversion was already in the oldest available version from Mar 7, 2004. The author who provided the file is no longer working on exiv2 and I have no hope that somebody else can remember, why this conversion is made. Perhaps this conversion was valid back almost 20 years ago and now Canon fills the tag without conversion. It could help, if somebody is able to compare the serial number on hardware with the tag value. There is also a tag called Exif.Canon.SerialNumberFormat in the images. I thought, this tag might define how to convert the value, but in Canon Digital Photo Professional the two different values I found had no influence. |
Well, this is a convincing evidence, that print returns the wrong serial number. So I will prepare a pull request for this. I also will check, how to deal with the order of tags for serial number in easy access. Hoping that changing the sequence does not make anything worse, I will prepare a pull request for that as well. |
An owner of an EOS 5D Mark III confirmed, that the plain number (the output of toString) is the one written on the body. But: During preparing the pull request I executed all test cases and compared output with Canon Digital Photo Professional. There I found one image from a D30, where the value of print matches output of Canon Digital Photo Professional. So in some cases print is correct, but I do not know the rule and decided not continue with the pull request before I or somebody else found the rule. |
I used Canon Digital Photo Professional to check the Canon sample images from ExifTool. From these images,
With these images 120 Canon models were covered. In general Canon Digital Photo Professional shows the value of Exif.Canon.SerialNumber just as number with leading zeros to fill up to 10 or 12 digits. Only for the image taken with a D30, serial number is shown like the current print function from exiv2. There is one image, where Exif.Photo.BodySerialNumber contains "aaaaaaaaaaaa", which - according to my opinion - most likely was written manually. But I hope, that this is an exception. Otherwise the analysis might be wrong. So based on these data, my conclusion is to continue as follows:
|
Did the image that I attached have the hex value in BodySerialNumber? |
No, hex value would be 8169F2D8, but Exif.Photo.BodySerialNumber shows -212376298. I see no relationship between this and the 2171204312 in Exif.Canon.SerialNumber. |
In easy access function serialNumber, the number returned is either 45 or -212376298
IMG_1089.zip
The text was updated successfully, but these errors were encountered: