metadata: fixed regression with older exiv2 versions

Fixes #246

(cherry picked from commit ac3e78c25ed5b14019661d5c6c58af15032e968d)
This commit is contained in:
Alberto Griggio 2022-04-18 23:47:58 -07:00 committed by Lawrence Lee
parent 2ac459e927
commit eb7c151260
No known key found for this signature in database
GPG Key ID: 048FF2B76A63895F

View File

@ -123,8 +123,15 @@ FramesData::FramesData(const Glib::ustring &fname) :
const auto find_exif_tag =
[&exif, &pos](const std::string &name) -> bool
{
pos = exif.findKey(Exiv2::ExifKey(name));
return pos != exif.end() && pos->size();
try {
pos = exif.findKey(Exiv2::ExifKey(name));
return pos != exif.end() && pos->size();
} catch (std::exception &e) {
if (settings->verbose) {
std::cerr << "Exiv2 WARNING -- error finding tag " << name << ": " << e.what() << std::endl;
}
return false;
}
};
const auto find_tag =