-
Notifications
You must be signed in to change notification settings - Fork 282
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
"Canon EF 80-200mm f/4.5-5.6 II" identified as "Canon EF 80-200mm f/4.5-5.6" #1906
Comments
Can you perhaps try to find some more supporting evidence for these 28 and 38 ID mappings independent of exiv2? Exiftool seems to have the same duplication, I wouldn't be surprised that's where exiv2 inherited it from... |
You can modify the lens recognition on your machine using the configuration file ~/.exiv2. This is documented in the man page. https://exiv2.org/manpage.html |
Thank You for providing a test image. Here's the configuration file being used. Before: 519 rmills@rmillsm1:~/Downloads $ curl -LO https://user-images.githubusercontent.com/74864103/133683539-5f296dc3-e156-46c1-86eb-0742cb32ebc8.jpg
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 56011 100 56011 0 0 320k 0 --:--:-- --:--:-- --:--:-- 331k
520 rmills@rmillsm1:~/Downloads $ exiv2 -g lens/i 133683539-5f296dc3-e156-46c1-86eb-0742cb32ebc8.jpg
Exif.CanonCs.LensType Short 1 Canon EF 80-200mm f/4.5-5.6
Exif.CanonCs.Lens Short 3 80.0 - 200.0 mm
Exif.CanonCf.LensAFStopButton Short 1 0
Exif.Canon.LensModel Ascii 70 EF80-200mm f/4.5-5.6 II
Exif.Photo.LensSpecification Rational 4 80/1 200/1 0/0 0/0
Exif.Photo.LensModel Ascii 70 EF80-200mm f/4.5-5.6 II
Exif.Photo.LensSerialNumber Ascii 12 0000000000
521 rmills@rmillsm1:~/Downloads $ exiv2 -pv -g lens/i 133683539-5f296dc3-e156-46c1-86eb-0742cb32ebc8.jpg
0x0016 CanonCs LensType Short 1 38
0x0017 CanonCs Lens Short 3 200 80 1
0x0009 CanonCf LensAFStopButton Short 1 0
0x0095 Canon LensModel Ascii 70 EF80-200mm f/4.5-5.6 II
0xa432 Photo LensSpecification Rational 4 80/1 200/1 0/0 0/0
0xa434 Photo LensModel Ascii 70 EF80-200mm f/4.5-5.6 II
0xa435 Photo LensSerialNumber Ascii 12 0000000000
522 rmills@rmillsm1:~/Downloads $ Configuration File: 522 rmills@rmillsm1:~/Downloads $ bbedit ~/.exiv2
523 rmills@rmillsm1:~/Downloads $ cat ~/.exiv2
[canon]
38=Put the lens name here
524 rmills@rmillsm1:~/Downloads $ After: 524 rmills@rmillsm1:~/Downloads $ exiv2 -g lens/i 133683539-5f296dc3-e156-46c1-86eb-0742cb32ebc8.jpg
Exif.CanonCs.LensType Short 1 Put the lens name here
Exif.CanonCs.Lens Short 3 80.0 - 200.0 mm
Exif.CanonCf.LensAFStopButton Short 1 0
Exif.Canon.LensModel Ascii 70 EF80-200mm f/4.5-5.6 II
Exif.Photo.LensSpecification Rational 4 80/1 200/1 0/0 0/0
Exif.Photo.LensModel Ascii 70 EF80-200mm f/4.5-5.6 II
Exif.Photo.LensSerialNumber Ascii 12 0000000000
524 rmills@rmillsm1:~/Downloads $ |
I found the lensfun github issue and pull request that uploaded calibration data for "Canon EF 80-200mm f/4.5-5.6 II" Calibration upload issue |
Thanks, but sadly there is no independent confirmation of the definitive mapping to LensType in those links, even though exiv2/exiftool could be responsible for the lensfun database discrepency... |
I'm not sure what's being discussed here as I know nothing about lensfun. Should this issue be closed? |
@clanmills Do you think we have enough evidence to "fix" the 38 mapping to |
There is no "bug" in the Exiv2 mapping table. The problem is that the lens is not in the metadata and has to be guessed by examination of other metadata. I don't know how the guess for 28 or 38 arrived in the code. If we change it, we'll break something that was working correctly for somebody else. The fix is to use the configuration file ~/.exiv2 to modify the lens recognition on your machine. I'm going to close this issue. |
I wouldn't be so sure Robin - there does seem to be a discrepancy w/ Canon's own MakerNote
|
@boardhead Any idea how exactly this info got into exiftool, the reference just says "private communication"... |
Well spotted, @kmilos. Why doesn't LensFun use Exif.CanonCs.LensType is a Short (value 38) which is being interpreted (pretty printed) by Exiv2. Because I'm not a photographer, I don't know know what LensFun does. However, it seems that the whole world demands that Exiv2 must guess the right lens. I feel it's the job of the mysterious LensFun to use the metadata which we read correctly. Grrrrr.... I am just a grumpy old man. If it makes people happy, use patch in the issue report: #1906 (comment) |
I'm not that old, but just as grumpy. For one reason or another it seems lensfun devs decided to use interpreted lens strings from exiv2/exiftool rather than immutable vendor metadata, and we have ourselves a catch 22 situation here... @John55h Can you submit a PR please? Obvioulsy you'll have to follow it up with a PR to lensfun as well... |
@kmilos. If you live long enough, one day you'll be as old as me. You'll never be as grumpy. 😄 @John55h Can you ask LensFun to carefully consider how they determine the lens from the metadata which Exiv2 parses correctly. There should be a cascade of keys to be inspected. The priority (of truth) is:
The manufacturer's makernote is different for every manufacturer and the manufacturer can (and does) change the structure from model-to-model. The "configuration file" is provided to enable the user to modify lens recognition locally on their machine. Which is the best metadata for LensFun to use? The Exif standard Exif.Photo.LensModel is best. Any ascii metadata such as Exif.Canon.LensModel is second best. Last resort is translated metadata such as Exif.CanonCs.LensType. The configuration file enables the user to modify the translated value of keys such as Exif.CanonCs.LensType. |
I know this issue is closed, but I'm OK with changing this. I can't contact the person who originally reported this lens, but even if some non-II variants have LensType 38 I don't mind changing this since adding "II" at least allows this lens to be differentiated from LensType 28.
|
With .exiv2 it is possible to force a lens recognition by using LensID, for example 142=Canon EF 300mm f2.8 L IS USM. Would it be possible to write other tags in the config file like: The reason why I ask is because this lens has the same lensID even together with converters. The converters show up in Exif.Photo.LensModel but not in LensType or LensID. Thanks |
@PeterWem You and I think alike. When I implemented the configuration file, I thought about having conditions and concluded that it would end up being a programming language. Here's the proposal: https://exiv2.org/book/#future I will be 71 on Tuesday. I retired from work in 2014 and retired from open-source last year. I don't believe I will ever have the time to implement M2LScript. I'd be happy to mentor a volunteer. In my day job, I wrote compilers and interpreters, so my skills are up to the task. The challenge is to totally stop work on Exiv2 to make time for M2LScript. Exiv2 can modify the LensID from |
Thank you very much for your advice! In ~.exiv2 I wrote 142=000. That solved the issue. I think because LensID 000 doesn't exist darktable ignores the tag LensType and continues to the next and the right tag LensModel instead. Now my Canon EF 300mm f2.8 L IS USM, Canon EF 300mm f2.8 L IS USM +1.4x, Canon EF 300mm f2.8 L IS USM + 1.4X II and Canon EF 300mm f2.8 L IS USM + 2x III all show the correct names instead of Canon EF 300mm f/2.8L IS for all four combinations. I suppose this will fail with older cameras that don't have the tags Exif.Photo.LensModel or Exif.Canon.LensModel, but that is a minor problem in my case. The original problem and the raw files free to download https://discuss.pixls.us/t/lensfun-not-finding-the-right-lens/26779/7?u=peter |
Btw, I think M2Lscript sounds like a great idea! |
I'm glad that we've got that fixed between us. I am still a smart guy at 71. Exif.Photo.LensModel is a recent addition to the Exif Spec. If the Exif Committee had added that 20 years ago, the lens recognition issue would not exist. I honestly don't feel that it is the responsibility of exiv2 or exiftool to recognise the lens. The responsibility of exiftool and exiv2 is to reliably read/modify/delete metadata. The M2Lscript proposal would establish lens recognition as a distinct technology that interprets metadata. However, like everybody, I've live in a world of 7x24 hours in a week. M2Lscript is probably a considerable undertaking. There are ways to simplify the engineering effort such as:
When M2Lscript is finished, the solution will be simple and obvious. The search for simple and obvious will be neither. |
This issue causes darktable to apply lens correction "Canon EF 80-200mm f/4.5-5.6" to images using "Canon EF 80-200mm f/4.5-5.6 II"
exiv2 0.27.4 output for Canon EF 80-200mm f/4.5-5.6 II
The original lens "Canon EF 80-200mm f/4.5-5.6" (I believe) is tagged 28 in TagDetails canonCsLensTtype[] (see canonmn_int.cpp) and the "II" version is tagged 38.
Output of exiv2 for Canon EF 80-200mm f/4.5-5.6 II after applying the patch below:
Darktable now correctly identifies this lens as version "II" and does not apply any correction (no lensfun data), I hope to add correction data to lensfun for this lens at some point.
Small jpeg with "Canon EF 80-200mm f/4.5-5.6 II"
The text was updated successfully, but these errors were encountered: