Bug #1361
Wrongly identified Canon 2x extender as 1.4x extender with Tamron lens
100%
Description
exiv2 0.25 (couldn't find a fix for the bug in the change log (only #1128 might be related), thus assume that it still exists) on Ubuntu 18.04.
Example file: www.muenster.de/~simonh/EQ2A0002.CR2
Used lens combination: "TAMRON SP 70-200mm F/2.8 Di VC USD G2 A025" and Canon Extender EF 2x III (normally recognized as "+2x III")
exiv2 seems to only recognize the extender as an 1.4x extender:
user@host:~$ EQ2A0002.CR2 | grep -ai lens
Exif.CanonCs.LensType Short 1 Canon EF 300mm f/2.8L IS II USM
Exif.CanonCs.Lens Short 3 98.0 - 280.0 mm
Exif.Canon.LensModel Ascii 74 TAMRON SP 70-200mm F/2.8 Di VC USD G2 A025 +1.4x III
Exif.Photo.LensSpecification Rational 4 98/1 280/1 0/1 0/1
Exif.Photo.LensModel Ascii 53 TAMRON SP 70-200mm F/2.8 Di VC USD G2 A025 +1.4x III
Exif.Photo.LensSerialNumber Ascii 11 0000000000
Thus also the focal lens values are wrong:
user@host:~$ exiv2 -pt EQ2A0002.CR2 | grep -ai focallength
Exif.Photo.FocalLength Rational 1 98.0 mm
Exif.Canon.FocalLength Short 4 98.0 mm
(In case it is relevant: same problem exists with exiftool: http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,9367.0.html)
Note: Not sure if the "Exif.CanonCs.LensType" information is imoportant, but that seems to be wrong as well -- even when used without an extender as seen below:
user@host:~$ exiv2 -pt EQ2A0001.CR2 | grep -ai lens
Exif.CanonCs.LensType Short 1 Canon EF 300mm f/2.8L IS II USM
Exif.CanonCs.Lens Short 3 70.0 - 200.0 mm
Exif.Canon.LensModel Ascii 74 TAMRON SP 70-200mm F/2.8 Di VC USD G2 A025
Exif.Photo.LensSpecification Rational 4 70/1 200/1 0/1 0/1
Exif.Photo.LensModel Ascii 43 TAMRON SP 70-200mm F/2.8 Di VC USD G2 A025
Exif.Photo.LensSerialNumber Ascii 11 0000000000
Example file: www.muenster.de/~simonh/EQ2A0001.CR2
Note: using the extender together with a Canon lens, it is correctly identified as 2x extender. See example file: www.muenster.de/~simonh/EQ2A9988.CR2
Thanks for your work!
Simon
Related issues
History
Updated by Robin Mills over 3 years ago
- Category set to lens
- Status changed from New to Assigned
- Assignee set to Robin Mills
- Target version set to 0.27
- % Done changed from 0 to 50
- Estimated time set to 1.00 h
Simon
Thank you for reporting this and thanks for providing a test file. Here's the output from Exiv2 v0.26:
526 rmills@rmillsmbp:~/gnu/exiv2/v0.26/build $ bin/exiv2 -pa --grep lens/i ~/Downloads/EQ2A9988.CR2 Exif.CanonCs.LensType Short 1 Canon EF 70-200mm f/2.8L IS II USM + 2x Exif.CanonCs.Lens Short 3 140.0 - 400.0 mm Exif.Canon.LensModel Ascii 74 EF70-200mm f/2.8L IS II USM +2x III Exif.Photo.LensSpecification Rational 4 140/1 400/1 0/1 0/1 Exif.Photo.LensModel Ascii 36 EF70-200mm f/2.8L IS II USM +2x III Exif.Photo.LensSerialNumber Ascii 11 0000413819 527 rmills@rmillsmbp:~/gnu/exiv2/v0.26/build $With Exiv2 v0.26 and later, you can change the lens recognition using the file ~/.exiv2. For your file:
503 rmills@rmillsmbp:~ $ exiv2 -pv --grep lens/i ~/Downloads/EQ2A9988.CR2 0x0016 CanonCs LensType Short 1 253 <--- This is the key 0x0017 CanonCs Lens Short 3 400 140 1 0x0095 Canon LensModel Ascii 74 EF70-200mm f/2.8L IS II USM +2x III 0xa432 Photo LensSpecification Rational 4 140/1 400/1 0/1 0/1 0xa434 Photo LensModel Ascii 36 EF70-200mm f/2.8L IS II USM +2x III 0xa435 Photo LensSerialNumber Ascii 11 0000413819Register the lens ID in ~/.exiv2
505 rmills@rmillsmbp:~ $ cat ~/.exiv2 [canon] 255=Simon's Canon 2x extender <--- Put your lens title hereAnd hey presto:
509 rmills@rmillsmbp:~ $ exiv2 -pa --grep lens/i ~/Downloads/EQ2A9988.CR2 Exif.CanonCs.LensType Short 1 Simon's Canon 2x extender Exif.CanonCs.Lens Short 3 140.0 - 400.0 mm Exif.Canon.LensModel Ascii 74 EF70-200mm f/2.8L IS II USM +2x III Exif.Photo.LensSpecification Rational 4 140/1 400/1 0/1 0/1 Exif.Photo.LensModel Ascii 36 EF70-200mm f/2.8L IS II USM +2x III Exif.Photo.LensSerialNumber Ascii 11 0000413819 510 rmills@rmillsmbp:~ $
Updated by Simon Harhues over 3 years ago
THX for your quick feedback Robin! Just to ensure that I didn't misunderstand you or in case I expressed myself not clearly enough: While there's actually no problem with the meta data in file EQ2A9988.CR2 but in the two other files given, I do understand that the procedure you mentioned generally works as a local workaround to correct wrongly recognized data. I thus could (temporarily) correct the recognition of the lens + extender combination locally for me. I would want the output of exiv2 for the lensfun recognition within darktable and actually I need it first of all to enable support for the lens + extender combination to lensfun as it is not supported yet. Thus as it is a general problem, I assume that it will get fixed in a future exiv2 version to let everybody benefit from the recognition.
Thanks again for your work!
Updated by Simon Harhues over 3 years ago
Edit: The problem with "Exif.CanonCs.LensType" seems to be more severe than I assumed, the Tamron lens is also without the extender wrongly identified as a Canon 300mm lens. Thus this should be corrected anyway to enable a correct working of lensfun. I've uploaded another example image of the Tamron lens without an extender: https://www.dropbox.com/s/6q1d54uyraot82r/EQ2A9987.CR2?dl=0
Feel free to use all images for improving exiv2 and other FOSS.
Updated by Robin Mills over 3 years ago
- % Done changed from 50 to 100
Lens recognition is difficult. The name of the lens is not encoded in the metadata. The manufacturer often encodes a "LensID" in the MakerNote. The MakerNote is "secret sauce" which has been mostly reverse engineered in Exiv2. The manufacturer frequently uses the same "LensID" for several different lenses. To deduce the lens, we have to inspect other metadata (such as min/max Aperture) to deduce the type of lens.
I wish Exiv2 had never become involved with lens recognition as it has given rise to hundreds of requests to recognise new lenses as they appear on the market. To enable users to "register" a new lens, the ~/.exiv2 mechanism was added in v0.26.
I appreciate the usefulness of lens recognition for lensfun. So, I feel that lensful should use Exiv2 to extract the metadata and deduce the lens in use.
The mission of Exiv2 is to correctly extract, add, delete and modify metadata according to the standards. The meaning of the metadata is another matter. I don't feel that deducing the lens type from the metadata is the business of Exiv2. Many folks disagree with my view. I have invited many to join Exiv2 to work on this very topic. Niels worked with me for several years on lens recognition. When he retired from the project, I added the ~/.exiv2 feature to give users some capability to recognise their lenses.
Perhaps a volunteer lens-enthusiast will join Team Exiv2 and take ownership of lens-recognition. However for the moment, I don't think anything can be done without another Engineer.
Updated by Simon Harhues over 3 years ago
Too bad to hear. I'll hope then as well, that a new maintainer will be found.
Updated by Robin Mills over 3 years ago
- Status changed from Assigned to Closed
Simon:
Thanks for getting back to me. Exiv2 is being actively maintained. I've put in about 10,000 hours over the last 10 years. I've recruited a couple of very talented engineers who are working hard on the build and test infrastructure, bigtiff and other projects. lens-recognition was given attention in v0.26 by adding the ~/.exiv2 feature.
We had a team meeting at my home in England in May 2018. A very nice weekend. We had fun, dinner, BBQ, a run in the country and discussed many aspects of Exiv2. Here's the pre-meeting document: http://dev.exiv2.org/projects/exiv2/news You'll see that topic 8.3 is "Enhanced lens recognition". So Team Exiv2 is well aware that many folks would like to see this subject get more attention.
I'm optimistic that a volunteer will join us and become the hero who will deal with this subject. Numerous design possibilities to improve lens recognition are discussed in this document: http://dev.exiv2.org/issues/1034
Updated by Simon Harhues over 3 years ago
Sorry if my brevity was misleading! Didn't want to give the impression that exiv2 isn't maintained or that I don't value your engagement Robin -- I really do value your work! I was just referring to the specific part of lens recognition (used by lensfun) mentioned by you.
Thanks again for your effort!
Updated by Robin Mills over 3 years ago
Thanks for the clarification. For sure I wanted you to know that good things are being done by Team Exiv2.
I have a potential volunteer to take on the lens recognition issue. However the person is fully occupied with business and family at the moment. I've even been wondering if I should take on the task myself in 2019 (once we have v0.27 released). One of my ideas is to embed a scripting language inside exiv2 which could execute arbitrary code for lens recognition. That would be a fun project.