@@ -2527,13 +2527,6 @@ std::ostream& printCsLensTypeByMetadata(std::ostream& os, const Value& value, co
2527
2527
return printCsLensFFFF (os, value, metadata);
2528
2528
}
2529
2529
2530
- // TODO: The lens identification could be improved further:
2531
- // 1. RF lenses also set Exif.CanonFi.RFLensType. If a lens cannot be found here then
2532
- // the RF mechanism could be used instead.
2533
- // 2. Exif.Photo.LensModel and Exif.Canon.LensModel provide a text description of the lens
2534
- // (e.g., "RF24-105mm F4-7.1 IS STM" - Note: no manufacturer or space after "RF").
2535
- // After parsing, the values could be used to search in the lens array.
2536
-
2537
2530
// get the values we need from the metadata container
2538
2531
ExifKey lensKey (" Exif.CanonCs.Lens" );
2539
2532
auto pos = metadata->findKey (lensKey);
@@ -2547,14 +2540,14 @@ std::ostream& printCsLensTypeByMetadata(std::ostream& os, const Value& value, co
2547
2540
auto const exifFlMin = static_cast <int >(static_cast <float >(pos->value ().toInt64 (1 )) / pos->value ().toFloat (2 ));
2548
2541
auto const exifFlMax = static_cast <int >(static_cast <float >(pos->value ().toInt64 (0 )) / pos->value ().toFloat (2 ));
2549
2542
2550
- ExifKey aperKey (" Exif.CanonCs.MinAperture " );
2543
+ ExifKey aperKey (" Exif.CanonCs.MaxAperture " );
2551
2544
pos = metadata->findKey (aperKey);
2552
2545
if (pos == metadata->end () || pos->value ().count () != 1 || pos->value ().typeId () != unsignedShort) {
2553
2546
os << " Unknown Lens (" << lensType << " )" ;
2554
2547
return os;
2555
2548
}
2556
2549
2557
- auto exifAperMin = fnumber (canonEv (static_cast <int16_t >(pos->value ().toInt64 (0 ))));
2550
+ auto exifAperMax = fnumber (canonEv (static_cast <int16_t >(pos->value ().toInt64 (0 ))));
2558
2551
2559
2552
// regex to extract short and tele focal length, max aperture at short and tele position
2560
2553
// and the teleconverter factor from the lens label
@@ -2595,8 +2588,8 @@ std::ostream& printCsLensTypeByMetadata(std::ostream& os, const Value& value, co
2595
2588
auto aperMaxTele = std::stof (base_match[4 ].str ()) * tc;
2596
2589
auto aperMaxShort = base_match[3 ].length () > 0 ? std::stof (base_match[3 ].str ()) * tc : aperMaxTele;
2597
2590
2598
- if (flMin != exifFlMin || flMax != exifFlMax || exifAperMin < (aperMaxShort - .1 * tc) ||
2599
- exifAperMin < (aperMaxTele + .1 * tc)) {
2591
+ if (flMin != exifFlMin || flMax != exifFlMax || exifAperMax < (aperMaxShort - .1 * tc) ||
2592
+ exifAperMax > (aperMaxTele + .1 * tc)) {
2600
2593
continue ;
2601
2594
}
2602
2595
0 commit comments