Commit 91fcbe9c authored by Lukáš Karas's avatar Lukáš Karas
Browse files

catch std::out_of_range exception from libexiv2

For some images, libexiv2 ( < 0.27.5) throws std::out_of_range,
when it tries to parse Xmp date. See this issue for more details:
https://bugs.kde.org/show_bug.cgi?id=441121

It is fixed in upstream libexiv2 and released in 0.27.5,
this is workaround for this issue with older libexiv.
parent 555f3024
......@@ -289,6 +289,10 @@ struct ImageMetaInfoModelPrivate {
} else {
hash.insert(key, new MetaInfoGroup::Entry(key, label, value));
}
} catch (const std::out_of_range &error) {
// Workaround for https://bugs.launchpad.net/ubuntu/+source/exiv2/+bug/1942799
// which was fixed with https://github.com/Exiv2/exiv2/pull/1918/commits/8a1e949bff482f74599f60b8ab518442036b1834
qCWarning(GWENVIEW_LIB_LOG) << "Failed to read some meta info:" << error.what();
} catch (const Exiv2::Error &error) {
qCWarning(GWENVIEW_LIB_LOG) << "Failed to read some meta info:" << error.what();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment