-
Notifications
You must be signed in to change notification settings - Fork 299
Closed
Labels
lensIssue related to lens detectionIssue related to lens detection
Description
Describe the bug
When probing exif information with exiv2 for a specific camera/lens combination (see below), for a relevant fraction of the images the lens gets not identified correctly: Although the ID seems to match, exiv2 is unable to identify the LensType-String.
- There is no obvious difference between the files.
- It occurs for images which where taken seconds apart
- It is reproducible per image, i.e. if the LensType cannot be identified by exiv2 the first time, the behaviour remains the same for consecutive calls to exiv2
This also affects downstreams products (as in this case darktable - the import stores the ID instead of the name, and automatic lens correction fails)
To Reproduce
Run exiv2 as shown below on the two provided, consecutively taken images.
- -pv: identical output concerning the LensType: 156
- -pa / -pt: For one image, the lens gets identified correctly, for the other just the id is shown
Expected behavior
exiv2 should resolve the lens for both images correctly, giving the desired output ("EF28-105mm f/3.5-4.5 USM").
Workaround
Place the lens identification in exiv2 config file:
[canon]
156=Canon EF 28-105mm f/3.5-4.5 USM
Desktop:
- OS and version: Windows 10
- Compiler and version (Download-Packages via https://www.exiv2.org/download.html:
-- MSVC 2019, exiv2-0.27.5-2019msvc64
-- MinGW, exiv2-0.27.5-MinGW64
Additional context
Camera: Canon EOS 400D
Lens: EF28-105mm f/3.5-4.5 USM (Identified with id 156)
Side Notes:
- The issue came up when trying to migrate from Lightroom to darktable. Lightroom was able to correctly interpret exif data, so I would assume that the files themselves are corrupted.
- The issue has not been seen for other lenses so far (Canon/Tamron with same camera, another Canon lens with another camera)
Console outputs:
// print all
.\exiv2.exe -pa --grep lens/i .\exif_correct.CR2
Exif.CanonCs.LensType Short 1 Canon EF 28-105mm f/3.5-4.5 USM
Exif.CanonCs.Lens Short 3 28.0 - 105.0 mm
Exif.CanonCf.LensAFStopButton Short 1 2048
Exif.Canon.LensModel Ascii 64 EF28-105mm f/3.5-4.5 USM
.\exiv2.exe -pa --grep lens/i .\exif_incorrect.CR2
Exif.CanonCs.LensType Short 1 156
Exif.CanonCs.Lens Short 3 28.0 - 105.0 mm
Exif.CanonCf.LensAFStopButton Short 1 2048
Exif.Canon.LensModel Ascii 64 EF28-105mm f/3.5-4.5 USM
// print plain exif
.\exiv2.exe -pv --grep lens/i .\exif_correct.CR2
0x0016 CanonCs LensType Short 1 156
0x0017 CanonCs Lens Short 3 105 28 1
0x0009 CanonCf LensAFStopButton Short 1 2048
0x0095 Canon LensModel Ascii 64 EF28-105mm f/3.5-4.5 USM
.\exiv2.exe -pv --grep lens/i .\exif_incorrect.CR2
0x0016 CanonCs LensType Short 1 156
0x0017 CanonCs Lens Short 3 105 28 1
0x0009 CanonCf LensAFStopButton Short 1 2048
0x0095 Canon LensModel Ascii 64 EF28-105mm f/3.5-4.5 USM
// print interpreted exif
.\exiv2.exe -pt --grep lens/i .\exif_correct.CR2
Exif.CanonCs.LensType Short 1 Canon EF 28-105mm f/3.5-4.5 USM
Exif.CanonCs.Lens Short 3 28.0 - 105.0 mm
Exif.CanonCf.LensAFStopButton Short 1 2048
Exif.Canon.LensModel Ascii 64 EF28-105mm f/3.5-4.5 USM
.\exiv2.exe -pt --grep lens/i .\exif_incorrect.CR2
Exif.CanonCs.LensType Short 1 156
Exif.CanonCs.Lens Short 3 28.0 - 105.0 mm
Exif.CanonCf.LensAFStopButton Short 1 2048
Exif.Canon.LensModel Ascii 64 EF28-105mm f/3.5-4.5 USM
Metadata
Metadata
Assignees
Labels
lensIssue related to lens detectionIssue related to lens detection