From 0415d556fc66e528374b2fa9d194197d8ddc16d0 Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Wed, 20 May 2020 16:31:33 +0200 Subject: [PATCH] exifpanel: ignore errors when printing tags in human-readable form (cherry picked from commit 47fa34e7365d618f250826eb412c72fe0ab8cfed) --- rtgui/exifpanel.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc index 44c70bc12..136e97b6e 100644 --- a/rtgui/exifpanel.cc +++ b/rtgui/exifpanel.cc @@ -303,10 +303,12 @@ void ExifPanel::refreshTags() const auto to_value = [&](Exiv2::Exifdatum &tag) -> Glib::ustring { - if (!tag.tagLabel().empty() && //tag.typeId() != Exiv2::undefined && - (tag.typeId() == Exiv2::asciiString || tag.size() < 256)) { - return escapeHtmlChars(tag.print(&exif)); - } + try { + if (!tag.tagLabel().empty() && //tag.typeId() != Exiv2::undefined && + (tag.typeId() == Exiv2::asciiString || tag.size() < 256)) { + return escapeHtmlChars(tag.print(&exif)); + } + } catch (std::exception &) {} return "(" + M("EXIFPANEL_VALUE_NOT_SHOWN") + ")"; };