Exiv2 / exiv2

Image metadata library and tools
http://www.exiv2.org/
Other
936 stars 282 forks source link

Canon EF 27-200mm f/2.8L IS II USM: Lenstype not properly detected by 0.28.3 #3052

Open MStraeten opened 1 month ago

MStraeten commented 1 month ago

Describe the bug

while lens model is properly detected, lenstype is not properly set:

exiv2 -pa --grep lens/i 20150718-IMG_7039.CR2
Exif.CanonCs.LensType                        Short       1  Canon EF 70-200mm f/2.8L IS II USM *OR* Canon EF 70-200mm f/2.8L IS III USM
Exif.CanonCs.Lens                            Short       3  70.0 - 200.0 mm
Exif.Canon.LensModel                         Ascii      74  EF70-200mm f/2.8L IS II USM
Exif.CanonLe.LensSerialNumber                Byte        5  000041f4cd
Exif.Photo.LensSpecification                 Rational    4  70-200mm
Exif.Photo.LensModel                         Ascii      28  EF70-200mm f/2.8L IS II USM
exiv2 -pv --grep lens/i 20150718-IMG_7039.CR2
0x0016 CanonCs      LensType                    Short       1  251
0x0017 CanonCs      Lens                        Short       3  200 70 1
0x0095 Canon        LensModel                   Ascii      74  EF70-200mm f/2.8L IS II USM
0x0000 CanonLe      LensSerialNumber            Byte        5  0 0 65 244 205
0xa432 Photo        LensSpecification           Rational    4  70/1 200/1 0/1 0/1
0xa434 Photo        LensModel                   Ascii      28  EF70-200mm f/2.8L IS II USM

To Reproduce

Steps to reproduce the behavior: file to reproduce: 20150718-IMG_7039.CR2

Expected behavior

exiv 0.27.6 properly identified that lens

Desktop (please complete the following information):

kmilos commented 1 month ago

In exiv2 0.27.x only the first match was printed. In 0.28.x the Canon detection/dealiasing code was improved, but all matches are printed in the rare case it can not narrow it down.

Unfortunately, there doesn't seem to be anything in the metadata the considers today that makes these two lenses distinguishable.

MStraeten commented 1 month ago

why does it work with LensModel? If you can’t distinguish LensType but LensModel, why not use the matching attribute to narrow down the matches?

kmilos commented 1 month ago

why does it work with LensModel?

LensModel is an actual string (as confirmed by -pv above), there is no ID number lookup necessary.

Not all Canon bodies used to output LensModel, and I think LensType predates it.

Feel free to use LensModel if you prefer and is suitable for your application and use case.