--- lib/exiv2imageloader.cpp 2014-09-30 17:11:42.000000000 +0800 +++ lib/exiv2imageloader.cpp 2024-07-14 14:12:10.000000000 +0800 @@ -57,17 +57,8 @@ try { d->mImage = Exiv2::ImageFactory::open((unsigned char*)data.constData(), data.size()); d->mImage->readMetadata(); -#if EXIV2_VERSION >= EXIV2_MAKE_VERSION(0, 14, 0) - // For some unknown reason, trying to catch Exiv2::Error fails with Exiv2 - // >=0.14. For now, just catch std::exception. I would welcome any - // explanation. } catch (const std::exception& error) { d->mErrorMessage = error.what(); -#else - // In libexiv2 0.12, Exiv2::Error::what() returns an std::string. - } catch (const Exiv2::Error& error) { - d->mErrorMessage = error.what().c_str(); -#endif return false; } return true; --- lib/imagemetainfomodel.cpp 2014-09-30 17:11:42.000000000 +0800 +++ lib/imagemetainfomodel.cpp 2024-07-14 14:13:06.000000000 +0800 @@ -280,7 +280,7 @@ } else { hash.insert(key, new MetaInfoGroup::Entry(key, label, value)); } - } catch (const Exiv2::Error& error) { + } catch (const std::exception& error) { kWarning() << "Failed to read some meta info:" << error.what(); } } --- lib/timeutils.cpp 2014-09-30 17:11:42.000000000 +0800 +++ lib/timeutils.cpp 2024-07-14 14:25:02.000000000 +0800 @@ -125,7 +125,7 @@ realTime = dt; return true; - } catch (const Exiv2::Error& error) { + } catch (const std::exception& error) { kWarning() << "Failed to read date from exif header of" << path << ". Error:" << error.what(); return false; } --- lib/jpegcontent.cpp 2014-09-30 17:11:42.000000000 +0800 +++ lib/jpegcontent.cpp 2024-07-14 14:22:28.000000000 +0800 @@ -540,12 +540,8 @@ { QImage image; if (!d->mExifData.empty()) { -#if(EXIV2_TEST_VERSION(0,17,91)) Exiv2::ExifThumbC thumb(d->mExifData); Exiv2::DataBuf thumbnail = thumb.copy(); -#else - Exiv2::DataBuf thumbnail = d->mExifData.copyThumbnail(); -#endif image.loadFromData(thumbnail.pData_, thumbnail.size_); } return image; @@ -566,12 +562,8 @@ return; } -#if (EXIV2_TEST_VERSION(0,17,91)) Exiv2::ExifThumb thumb(d->mExifData); thumb.setJpegThumbnail((unsigned char*)array.data(), array.size()); -#else - d->mExifData.setJpegThumbnail((unsigned char*)array.data(), array.size()); -#endif } bool JpegContent::save(const QString& path)