Lens identification mismatch
Added by Francois Edelin about 5 years ago
Hello,
I use Canon 7Dm2/5Dm3 with tamron 24-70 VC and develop to tiff with Darktable 2.0.7/lensfun 0.2.8-3
exiv2 is in version 2.14
how come my lens is identified as a Sigma? A lack of lens ID in the exif from both brands? Any way to avoid this? (other than selling the tamron to buy a sigma :-))
Exif.CanonCs.LensType Short 1 Sigma 24-70mm f/2.8 IF EX DG HSM
Exif.CanonCs.Lens Short 3 24.0 - 70.0 mm
Exif.Canon.LensModel Ascii 74 24-70mm
Exif.Photo.LensSpecification Rational 4 24/1 70/1 0/1 0/1
Exif.Photo.LensModel Ascii 8 24-70mm
Exif.Photo.LensSerialNumber Ascii 11 0000000000
Thank you for your support
Francois
Replies (8)
RE: Lens identification mismatch - Added by Robin Mills about 5 years ago
Can you attach a test image to this thread please?
Lens identification requires a "heuristic" (guess). The lens is recognised by a numerical value in the metadata and exiv2 has a table to convert the number to a string. Unfortunately, the (numerical) lensID is frequently used by several different lenses. We then use code to inspect focal length and other metadata to figure/guess which lens is in use. In your case, I believe your lensID is 137:
732 rmills@rmillsmbp:~/gnu/exiv2/trunk/src $ grep 'Sigma 24-70mm f/2.8 IF EX DG HSM' canonmn.cpp { 137, "Sigma 24-70mm f/2.8 IF EX DG HSM" }, // 4 733 rmills@rmillsmbp:~/gnu/exiv2/trunk/src $You'll be unhappy to discover (in src/canonmn.cpp) that we know about 17 lenses that use that lensID.
{ 137, "Canon EF 85mm f/1.2L" }, // 0 { 137, "Sigma 18-50mm f/2.8-4.5 DC OS HSM" }, // 1 { 137, "Sigma 50-200mm f/4-5.6 DC OS HSM" }, // 2 { 137, "Sigma 18-250mm f/3.5-6.3 DC OS HSM" }, // 3 { 137, "Sigma 24-70mm f/2.8 IF EX DG HSM" }, // 4 { 137, "Sigma 18-125mm f/3.8-5.6 DC OS HSM" }, // 5 { 137, "Sigma 17-70mm f/2.8-4 DC Macro OS HSM | C" }, // 6 { 137, "Sigma 17-50mm f/2.8 OS HSM" }, // 7 { 137, "Sigma 18-200mm f/3.5-6.3 DC OS HSM [II]" }, // 8 { 137, "Tamron AF 18-270mm f/3.5-6.3 Di II VC PZD" }, // 9 { 137, "Sigma 8-16mm f/4.5-5.6 DC HSM" }, // 10 { 137, "Tamron SP 17-50mm f/2.8 XR Di II VC" }, // 11 { 137, "Tamron SP 60mm f/2 Macro Di II" }, // 12 { 137, "Sigma 10-20mm f/3.5 EX DC HSM" }, // 13 { 137, "Tamron SP 24-70mm f/2.8 Di VC USD" }, // 14 { 137, "Sigma 18-35mm f/1.8 DC HSM" }, // 15 { 137, "Sigma 12-24mm f/4.5-5.6 DG HSM II" }, // 16In the next release of Exiv2 (v0.26 which is currently at RC1 and may ship in 2016), we have added a new feature to allow you to enter the name of your lens in the file ~/.exiv2 This is described: http://dev.exiv2.org/projects/exiv2/wiki/Lens_Recognition_in_Exiv2_v026_(and_later)/
Although exiv2 v0.26 has not shipped, it is possible that your version of darktable already supports this feature. Pascal de Brujin cherrypicks code from our trunk and updates exiv2 v0.25 installed on many linux distributions. Please let me know if it works for you.
If however, this doesn't work on your version of darktable, exiv2 v0.26 will ship and be included in darktable next year. You can build darktable to include exiv2 from our trunk and I believe that is working.
You can determine the lensID using the exiv2 option -pv
. For example:
735 rmills@rmillsmbp:~/gnu/exiv2/trunk/src $ exiv2 -pv --grep lens/i http://clanmills.com/Stonehenge.jpg 0x0083 Nikon3 LensType Byte 1 14 0x0084 Nikon3 Lens Rational 4 180/10 2500/10 35/10 63/10 0x008b Nikon3 LensFStops Undefined 4 55 1 12 0 0x000c NikonLd3 LensIDNumber Byte 1 146 0x000d NikonLd3 LensFStops Byte 1 55 736 rmills@rmillsmbp:~/gnu/exiv2/trunk/src $
RE: Lens identification mismatch - Added by Francois Edelin about 5 years ago
Hi Robin,
Thank you for your quick support. I was suspecting is lack of ID (or same ID for several lens) as I already had the problem with DxO/Mac.
Being able to set up manually a name for an ID is a great solution. I currently do not have any existing ~/.exiv2 file, shall I create one from scratch?
Attached the requested file (the size of the RAW is beyond the 20MB allowed for upload)
Best regards,
Francois
160807_1155-#6017.jpg (3.56 MB) 160807_1155-#6017.jpg | RAW->JPG EOS7DM2+TAMRON24-70VC_USD |
RE: Lens identification mismatch - Added by Robin Mills about 5 years ago
Here's what happens when I use your image on the trunk version of exiv2:
742 rmills@rmillsmbp:~/gnu/exiv2/trunk $ exiv2 -pv --grep lens/i 160807_1155-%236017.jpg 0x0016 CanonCs LensType Short 1 137 0x0017 CanonCs Lens Short 3 70 24 1 0x0009 CanonCf LensAFStopButton Short 1 0 0x0095 Canon LensModel Ascii 74 24-70mm 0xa432 Photo LensSpecification Rational 4 24/1 70/1 0/1 0/1 0xa434 Photo LensModel Ascii 8 24-70mm 0xa435 Photo LensSerialNumber Ascii 11 0000000000 743 rmills@rmillsmbp:~/gnu/exiv2/trunk $ exiv2 -pa --grep lens/i 160807_1155-%236017.jpg Exif.CanonCs.LensType Short 1 Sigma 24-70mm f/2.8 IF EX DG HSM Exif.CanonCs.Lens Short 3 24.0 - 70.0 mm Exif.CanonCf.LensAFStopButton Short 1 0 Exif.Canon.LensModel Ascii 74 24-70mm Exif.Photo.LensSpecification Rational 4 24/1 70/1 0/1 0/1 Exif.Photo.LensModel Ascii 8 24-70mm Exif.Photo.LensSerialNumber Ascii 11 0000000000 744 rmills@rmillsmbp:~/gnu/exiv2/trunk $You can download last night's build (which includes exiv2) from our buildserver: http://exiv2.dyndns.org:8080/userContent/builds/Latest/
However, you cannot replace the libexiv2.14.so with the latest from the buildserver. Although the buildserver delivers a file called "libexiv2.14.mumble", it is a development version and no longer a plug replacement.
744 rmills@rmillsmbp:~/gnu/exiv2/trunk $ exiv2 -vVg library | grep exiv2 exiv2 0.25 001900 (64 bit build) library=/usr/local/lib/libexiv2.14.dylib 745 rmills@rmillsmbp:~/gnu/exiv2/trunk $However you can run exiv2 from the buildserver and see if it recognises your lens. There's also a possibility that (thanks to Pascal's wonderful work), you be in luck and it will work.
While you are messing with our buildserver, I'll look at your file with Darktable 2.0.7/lensfun 0.2.8-3 on Linux.
RE: Lens identification mismatch - Added by Francois Edelin about 5 years ago
I get the topic but do not really understand how to proceed (and don't want to loose too much of your time teaching me linux "how to")
I like the idea that the next exiv2 release will provide this custom lens name ability. Especially that I am considering buy an IRIX lens soon
Meanwhile, I would use one CF per lens during shooting and would apply a Darktable "Sigma2Tamron" custom style on a per upload basis.
RE: Lens identification mismatch - Added by Robin Mills about 5 years ago
I've go this "sort of" working. Here's what I can see:
877 rmills@rmillsmbp-ubuntu:~/gnu/exiv2/trunk $ cat ~/.exiv2 [canon] 137=tamron 24-70 VC from Francois 878 rmills@rmillsmbp-ubuntu:~/gnu/exiv2/trunk $ exiv2 -pa --grep lens/i ~/Downloads/160807_1155-%236017.jpg Exif.CanonCs.LensType Short 1 tamron 24-70 VC from Francois <--- GOOD eh? Exif.CanonCs.Lens Short 3 24.0 - 70.0 mm Exif.CanonCf.LensAFStopButton Short 1 0 Exif.Canon.LensModel Ascii 74 24-70mm Exif.Photo.LensSpecification Rational 4 24/1 70/1 0/1 0/1 Exif.Photo.LensModel Ascii 8 24-70mm Exif.Photo.LensSerialNumber Ascii 11 0000000000Pascal has been busy and I believe he has updated darktable with the feature to read from ~/.exiv2 https://launchpad.net/~pmjdebruijn/+archive/ubuntu/darktable-release Try installing Pascal's latest and greatest. I think you will have the ~/.exiv2 feature.
For me, I am hanging darktable when I import your file and suspect it's because I have the (incompatible) trunk build in my /usr/local/lib/libexiv2.14.so
I'm going to reboot and try a little brain surgery on the machine. I'm 80% confident that I'll get this working by 20:00GMT and 20% confident that I'll give up!
Pascal is a very nice (and clever/diligent/good) guy. If I don't get it to work for you, it's quite likely he'll help you.
RE: Lens identification mismatch - Added by Robin Mills about 5 years ago
We're close, and a little out of luck.
I've imported your image and the lens shows up as "Sigma bla dee bla". However there's no question that we're using Pascal's modified libexiv2.14.0.0.
904 rmills@rmillsmbp-ubuntu:/usr $ lsof | grep darktable | grep libexiv2 darktable 6138 rmills mem REG 8,1 2615496 665187 /usr/lib/x86_64-linux-gnu/libexiv2.so.14.0.0 ... 909 rmills@rmillsmbp-ubuntu:~/Downloads $ ls -alt /usr/lib/x86_64-linux-gnu/libexiv2.so.14.0.0 -rw-r--r-- 1 root root 2615496 May 19 06:19 /usr/lib/x86_64-linux-gnu/libexiv2.so.14.0.0 910 rmills@rmillsmbp-ubuntu:~/Downloads $So, we're reached 100% not yet with this feature. However it will come to darktable soon. No need to trouble Pascal at this time. Of course you're always welcome to thank him and his friends for darktable.
We're done on this 7 minutes ahead of schedule at 19:53GMT.
RE: Lens identification mismatch - Added by Francois Edelin about 5 years ago
I agree, it's not a major issue as using lens in the medium values make distortions invisible, especially for transtandard like 24-70.
Thank you for having tried anyway.
Best Regards from Switzerland
Francois
RE: Lens identification mismatch - Added by Robin Mills about 5 years ago
As you've probably noticed that I'm a software guy. I know very little about photography and have no idea what lensfun does and little understanding of darktable.
Photography is next on the bucket list. http://clanmills.com/BucketList.shtml
Since retiring in 2014, we have totally remodelled our home and about to set of on a journey around the world. On our trip, we'll visit Andreas who is the founder of Exiv2 and wrote a lot of the code. He is also from Switzerland. Today he lives in the Far East.