Bug 271153

Summary: Tokina AT-X 107 AF DX Fish-eye not recognised
Product: [Applications] digikam Reporter: Milan Knížek <knizek>
Component: Metadata-EngineAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: ahuggel, caulier.gilles
Priority: NOR    
Version: 2.0.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 2.0.0
Sentry Crash Report:
Attachments: $ exiv2 -ea image.cr2
001 patch for exiv2 0.21.1 - adding Tokina lens to existing Canon and Tamron
002 patch for exiv2 0.21.1 - adding Tokina lens and deleting existing Canon and Tamron

Description Milan Knížek 2011-04-17 14:11:20 UTC
Created attachment 59062 [details]
$ exiv2 -ea image.cr2

Version:           2.0.0 (using KDE 4.6.0) 
OS:                Linux

Please add the support for recognition of Tokina AT-X 107 AF DX Fish-eye 10-17mm f/3.5-4.5 from Exif.

Extracted exv is attached. Should the raw file be needed, let me know (25 MB).



Reproducible: Always

Steps to Reproduce:
Open digikam editor and try Enhance/Lens/autocorrect

Actual Results:  
It gets recognised as Canon EF 20-35mm f/3.5-4.5 USM.


exiv2 0.21.1-1 shows
$ exiv2 -pt 2_04.cr2  | grep -i lens
Exif.CanonCs.LensType Short     1  Canon EF 20-35mm f/3.5-4.5 USM
Exif.CanonCs.Lens     Short     3  10.0 - 17.0 mm
Exif.Canon.LensModel  Ascii    70  10-17mm

exiftool 8.21-1 shows
$ exiftool 2_04.cr2 | grep -i lens
Lens Type            : Canon EF 20-35mm f/3.5-4.5 USM or Tamron Lens
Lens Model           : 10-17mm
Lens Drive No AF     : Focus search on
Lens AF Stop Button  : AF stop
Lens                 : 10.0 - 17.0 mm
Lens ID              : Unknown (160) 10-17mm
Lens                 : 10.0 - 17.0 mm (35 mm equivalent: 9.8 - 16.6 mm)
Comment 1 caulier.gilles 2011-04-17 14:16:26 UTC
Andreas,

There is something to do in Exiv2, or i need to wrap this Lens description string in digiKam for LensFun library ?

Gilles Caulier
Comment 2 Andreas Huggel 2011-04-18 01:58:12 UTC
The lens needs to be added to the list in canonmn.cpp. (The mapping is not always unique, several different lenses use the same codes, see the exiftool output: ... OR ...)
Comment 3 Milan Knížek 2011-04-18 17:56:33 UTC
Created attachment 59104 [details]
001 patch for exiv2 0.21.1 - adding Tokina lens to existing Canon and Tamron
Comment 4 Milan Knížek 2011-04-18 17:58:16 UTC
Created attachment 59105 [details]
002 patch for exiv2 0.21.1 - adding Tokina lens and deleting existing Canon and Tamron
Comment 5 Milan Knížek 2011-04-18 18:00:52 UTC
The Tokina lens seems to use id 160.

Adding an extraline to canonmn.cpp (see the attached file 001....patch) does not
help - exiv2 still reports it as Canon.

Deleting all existing lines with id 160 and adding a new line just for Tokina
(see the attached file 002...patch) works as expected - exiv2 recognises the
lens as Tokina.

Is there any other logic in exiv2, which makes some fuzzy checks e.g. of focal
length and apperture values within the name of the lens?
Comment 6 caulier.gilles 2011-04-19 08:40:50 UTC
Andreas, 

See patches and comment #5 from Milan...

Gilles Caulier
Comment 7 Andreas Huggel 2011-04-20 12:28:08 UTC
Milan, yes, another line is necessary to enable the magic that checks the focal length. With the patch below it works on the exv file you attached. I've checked in the change.

Andreas

--- canonmn.cpp	(revision 2473)
+++ canonmn.cpp	(working copy)
@@ -551,6 +551,7 @@
         { 156, "Canon EF 28-105mm f/3.5-4.5 USM"                            },
         { 160, "Canon EF 20-35mm f/3.5-4.5 USM"                             }, // 0
         { 160, "Tamron AF 19-35mm f/3.5-4.5"                                }, // 1
+        { 160, "Tokina AT-X 107 AF DX Fish-eye 10-17mm f/3.5-4.5"           }, // 2
         { 161, "Canon EF 28-70mm f/2.8L"                                    }, // 0
         { 161, "Sigma 24-70mm EX f/2.8"                                     }, // 1
         { 161, "Sigma 28-70mm f/2.8 EX"                                     }, // 2
@@ -671,6 +672,7 @@
         { 150, printCsLensByFocalLength },
         { 152, printCsLensByFocalLength },
         { 153, printCsLensByFocalLength },
+        { 160, printCsLensByFocalLength },
         { 161, printCsLensByFocalLength },
         { 169, printCsLensByFocalLength },
         { 173, printCsLensByFocalLength }, // works partly
Comment 8 Milan Knížek 2011-04-20 18:25:05 UTC
Thanks, Andreas. exiv2 works not as expected. (And the information displayed in dk's image properties tab as well.)
Comment 9 Milan Knížek 2011-04-20 18:42:37 UTC
Eh, I wanted to type "exiv2 works _now_ as expected".
Comment 10 caulier.gilles 2011-04-20 22:58:07 UTC
Andreas, 

Do you have patched Exiv2 source code ?

Gilles Caulier
Comment 11 Milan Knížek 2011-04-21 20:33:35 UTC
It seems the patch was checked in:
http://dev.exiv2.org/projects/exiv2/repository/revisions/2474
Milan
Comment 12 caulier.gilles 2011-04-22 06:45:01 UTC
Thanks i close this file now...

Gilles Caulier