Fix Canon lens detection (#2057)
The Canon RF 24-105 F4-7.1 IS STM lens is reported as using an
Exif.CanonCs.MaxAperture of F7.3 instead of F7.1. As a result,
the translation of Exif.CanonCs.LensType is missing.
Fix updates the CanonEV() decode function to provide the correct
value.
Closes #2057.
Codecov Report
Merging #2235 (8d36bcc) into main (19dc566) will increase coverage by
0.05%. The diff coverage is100.00%.
@@ Coverage Diff @@
## main #2235 +/- ##
==========================================
+ Coverage 63.42% 63.47% +0.05%
==========================================
Files 117 118 +1
Lines 19593 19614 +21
Branches 9551 9567 +16
==========================================
+ Hits 12426 12450 +24
+ Misses 5098 5096 -2
+ Partials 2069 2068 -1
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/canonmn_int.cpp | 72.02% <100.00%> (+0.46%) |
:arrow_up: |
| app/app_utils.cpp | 33.33% <0.00%> (-12.13%) |
:arrow_down: |
| app/exiv2.cpp | 62.55% <0.00%> (-0.03%) |
:arrow_down: |
| app/actions.hpp | 100.00% <0.00%> (ø) |
|
| app/exiv2app.hpp | 100.00% <0.00%> (ø) |
|
| src/nikonmn_int.cpp | 57.10% <0.00%> (ø) |
|
| src/crwimage_int.hpp | 93.02% <0.00%> (ø) |
|
| src/makernote_int.hpp | 92.30% <0.00%> (ø) |
|
| src/tiffimage_int.cpp | 77.90% <0.00%> (ø) |
|
| include/exiv2/value.hpp | 84.44% <0.00%> (ø) |
|
| ... and 5 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 0561392...8d36bcc. Read the comment docs.
What's the current status on this?
@kevinbackhouse
What's the current status on this?
I will try and take a look tomorrow and then update you.
@kevinbackhouse
What's the current status on this?
The reason for this PR is that the lens in a user's file was incorrectly reported. The problem is that our knowledge of the Canon decoder is incomplete and the data in the user's file mapped to the wrong value. I made a commit that added an exception to the decoding function to correctly report the value.
As the decoder is used in multiple places, the outstanding issue is whether the fix I made might causes problems elsewhere. However, we already have another exception in the decoding code for a Sigma lens so this type of change has already been used for some time without reported issue. I looked in the ExifTool source code and they have the same basic formula but don't have any exceptions.
@hassec As you have experience of Canon files, do you have any suggestions to move this PR forward?