Project

General

Profile

Bug #10528

Lens type is not read for some Canon cameras (particularly old ones, e.g. 5D Classic)

Added by Khalid Kunji almost 5 years ago. Updated over 3 years ago.

Status:
Fixed
Priority:
Low
Assignee:
Category:
Darkroom
Target version:
Start date:
06/13/2015
Due date:
% Done:

100%

Estimated time:
Affected Version:
git development version
System:
all
bitness:
64-bit
hardware architecture:
amd64/x86

Description

DT version 1.6.7
LensFun version 0.2.8-1pmjdebruijn4~trusty
Exiv2 version exiv2 0.23 001700 (64 bit build)
Ubuntu 14.04 LTS, all those packages are from pmjdebruijn's ppa.

Associated revisions

Revision 29cae8db (diff)
Added by Roman Lebedev almost 5 years ago

Exif: ignore Exif.CanonCs.LensType if it contains "(0)". Fixes #10528
Try to look for other fields containing lens name.

Canon stores lens name in several fields:
$ exiv2 -pt 5D.CR2 | grep -ai lens
Exif.CanonCs.LensType Short 1 (0)
Exif.CanonCs.Lens Short 3 180.0 mm
Exif.CanonCf.LensAFStopButton Short 1 2049
Exif.Canon.LensModel Ascii 64 EF180mm f/3.5L Macro USM
$ exiv2 -pt 5DMk3.CR2 | grep -ai lens
Exif.CanonCs.LensType Short 1 Canon EF 70-200mm f/2.8L IS II 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.Photo.LensSpecification Rational 4 70/1 200/1 0/1 0/1
Exif.Photo.LensModel Ascii 28 EF70-200mm f/2.8L IS II USM
Exif.Photo.LensSerialNumber Ascii 11 0000c26687

In most cases, Exif.CanonCs.LensType will contain needed info, but if it
does not, we need to look at other fields.
Maybe we should also look at Exif.Photo.LensModel, but without a sample
that would cause an issue i do not want to change anything.

I have checked, and LensFun seems to be fine with the lens name from Exif.Canon.LensModel

Revision 4497549b (diff)
Added by Roman Lebedev almost 5 years ago

Exif: ignore Exif.CanonCs.LensType if it contains "(0)". Fixes #10528
Try to look for other fields containing lens name.

Canon stores lens name in several fields:
$ exiv2 -pt 5D.CR2 | grep -ai lens
Exif.CanonCs.LensType Short 1 (0)
Exif.CanonCs.Lens Short 3 180.0 mm
Exif.CanonCf.LensAFStopButton Short 1 2049
Exif.Canon.LensModel Ascii 64 EF180mm f/3.5L Macro USM
$ exiv2 -pt 5DMk3.CR2 | grep -ai lens
Exif.CanonCs.LensType Short 1 Canon EF 70-200mm f/2.8L IS II 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.Photo.LensSpecification Rational 4 70/1 200/1 0/1 0/1
Exif.Photo.LensModel Ascii 28 EF70-200mm f/2.8L IS II USM
Exif.Photo.LensSerialNumber Ascii 11 0000c26687

In most cases, Exif.CanonCs.LensType will contain needed info, but if it
does not, we need to look at other fields.
Maybe we should also look at Exif.Photo.LensModel, but without a sample
that would cause an issue i do not want to change anything.

I have checked, and LensFun seems to be fine with the lens name from Exif.Canon.LensModel

(cherry picked from commit 29cae8db2f4b41ef53ed527153abc5561f14de2e)

Revision 41deef6a (diff)
Added by Roman Lebedev almost 4 years ago

dt_exif_read_exif_data(): Exif.CanonCs.LensType: ignore (65535).

Fixes #10528

Revision 4d4fcba2 (diff)
Added by Roman Lebedev almost 4 years ago

dt_exif_read_exif_data(): Exif.CanonCs.LensType: ignore (65535).

Fixes #10528

(cherry picked from commit 41deef6ad3c8c184acdfd1c8d13effb7cd2f3346)

History

#1 Updated by Khalid Kunji almost 5 years ago

Rather, it does not identify this lens and camera combination, the focal length is correctly identified, the lens field in the image information on the left says (0) for the lens name.
The camera is a 5D (the first one, "classic," not the II or III). The lens is the Canon 400mm f/5.6, but it seems looking now that it is also the case for the Canon 28-135 IS USM lens. The default lens it shows in the module is the 300mm f/2.8 II with 2x TC. Sometimes it gives the message "camera/lens not found - please select manually" but mostly it does not.

#2 Updated by Roman Lebedev almost 5 years ago

  • System changed from Ubuntu to all
  • Affected Version changed from 1.6.7 to git development version
  • % Done changed from 0 to 10
  • Assignee set to Roman Lebedev
  • Status changed from New to Confirmed

Reproduced with RAW_CANON_5D_ARGB.CR2 from rawsamples

#3 Updated by Roman Lebedev almost 5 years ago

  • % Done changed from 10 to 100
  • Status changed from Confirmed to Fixed

#4 Updated by Roman Lebedev almost 5 years ago

  • Subject changed from Incorrect Default Lens in the Lens Correction Module to Lens type is not read for some Canon cameras (particularly old ones, e.g. 5D Classic)

#5 Updated by Tomasz Golinski almost 4 years ago

This bug still affects some cameras, e.g. 30D. In my case I get:

exiv2 -p t img_6967.cr2 |grep -i lens
Exif.CanonCs.LensType Short 1 (65535)
Exif.CanonCs.Lens Short 3 70.0 - 200.0 mm
Exif.CanonCf.LensAFStopButton Short 1 2304
Exif.Canon.LensModel Ascii 64 EF70-200mm f/4L USM

Broken value is in this case "(65535)", not "(0)". I ammended exif.cc accordingly but now for some reason Darktable doesn't pick lens name at all - field is empty. I'm using Darktable-2.0.5 and Exiv2-0.25.

#6 Updated by Roman Lebedev almost 4 years ago

  • % Done changed from 100 to 20
  • Status changed from Fixed to Incomplete

A sample with such issue will be needed.

#7 Updated by Tomasz Golinski almost 4 years ago

Raw file at https://www.rawsamples.ch/raws/canon/30d/RAW_CANON_30D.CR2 has
Exif.CanonCs.LensType equal to (65535), however it has empty Exif.Canon.LensModel tag. AFAIK it happens with 3rd party lenses. I uploaded my sample file to: tomaszg.pl/img_8183.cr2, it has non-empty Exif.Canon.LensModel tag.

Let me correct my previous post - simple amendment of exif.cc adding 65535 check works fine. I had a misfortune to test it on a file with empty LensModel tag.

/* Read lens name */
if((FIND_EXIF_TAG("Exif.CanonCs.LensType") && pos->print(&exifData) != "(0)" && pos->print(&exifData) != "(65535)") || FIND_EXIF_TAG("Exif.Canon.LensModel"))

Edit: Some lens names are not recognized by LensFun - eg. "EF50mm f/1.4 USM" but that's fairly minor problem.

#8 Updated by Roman Lebedev almost 4 years ago

  • % Done changed from 20 to 100
  • Status changed from Incomplete to Fixed

#9 Updated by Roman Lebedev over 3 years ago

  • Target version set to 2.2.0

Also available in: Atom PDF

Go to top