From e7bf1f0d299c4f7c6529438059d14e7a99907066 Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Sun, 4 Jun 2023 18:04:59 +0200
Subject: [PATCH] Fix build with exiv2 0.28

Index: plugins/impex/tiff/kis_tiff_import.cc
--- plugins/impex/tiff/kis_tiff_import.cc.orig
+++ plugins/impex/tiff/kis_tiff_import.cc
@@ -1840,7 +1840,11 @@ KisTIFFImport::convert(KisDocument *document,
         try {
             KisExiv2IODevice::ptr_type basicIoDevice(new KisExiv2IODevice(filename()));
 
+#if EXIV2_TEST_VERSION(0,28,0)
+            const std::unique_ptr<Exiv2::Image> readImg = Exiv2::ImageFactory::open(std::move(basicIoDevice));
+#else
             const std::unique_ptr<Exiv2::Image> readImg(Exiv2::ImageFactory::open(basicIoDevice).release());
+#endif
 
             readImg->readMetadata();
 
@@ -1908,8 +1912,13 @@ KisTIFFImport::convert(KisDocument *document,
 
             // Inject the data as any other IOBackend
             io->loadFrom(layer->metaData(), &ioDevice);
+#if EXIV2_TEST_VERSION(0,28,0)
+        } catch (Exiv2::Error &e) {
+            errFile << "Failed metadata import:" << Exiv2::Error(e.code()).what();
+#else
         } catch (Exiv2::AnyError &e) {
             errFile << "Failed metadata import:" << e.code() << e.what();
+#endif
         }
     }
 
