metadata: work around misidentification of some Canon RF lenses with teleconverter

(cherry picked from commit 3aae273f862f0c1611a134c6e84f460bba83bcf4)
This commit is contained in:
Alberto Griggio
2022-04-11 23:11:27 -07:00
committed by Lawrence Lee
parent c7d5b5076d
commit 9fd136c2f3

View File

@@ -281,9 +281,15 @@ FramesData::FramesData(const Glib::ustring &fname) :
if (find_tag(Exiv2::lensName)) {
lens = validateUft8(pos->print(&exif)); // validateUft8 (#5923) still needed?
if (pos->count() == 1 && lens == std::to_string(pos->toLong()) &&
find_exif_tag("Exif.Photo.LensModel")) {
auto p = pos;
if (find_exif_tag("Exif.CanonFi.RFLensType") && find_exif_tag("Exif.Canon.LensModel")) {
lens = validateUft8(pos->print(&exif)); // validateUft8 (#5923) still needed?
if (Glib::ustring(lens).lowercase().find("canon") == Glib::ustring::npos) {
lens = std::string("Canon ") + lens;
}
} else if (p->count() == 1 && lens == std::to_string(p->toLong()) &&
find_exif_tag("Exif.Photo.LensModel")) {
lens = validateUft8(p->print(&exif)); // validateUft8 (#5923) still needed?
}
} else if (find_exif_tag("Exif.Photo.LensSpecification") && pos->count() == 4) {
const auto round =