Source: pinot
Version: 1.21-1
Severity: important
Tags: patch ftbfs
Control: forwarded -1 https://github.com/FabriceColin/pinot/pull/11

Hi,

pinot fails to build with the new stable series of the Exiv2 library,
i.e. 0.28.x; that version is available in experimental as of this
writing.

Upstream recently merged a PR to fix this [1]. I extracted the
patch/commit from that upstream PR, and verified that it builds fine
with both Exiv2 0.27 and Exiv2 0.28; you can find it attached to this
bug. Would you review this patch, and upload it so that pinot rebuilds
cleanly once a newer Exiv2 is uploaded to unstable?

[1] https://github.com/FabriceColin/pinot/pull/11

Thanks,
-- 
Pino
>From b52b8184a260e77bc72fea3e8e5bd163cf36b79d Mon Sep 17 00:00:00 2001
From: Pino Toscano <toscano.p...@tiscali.it>
Date: Sun, 25 Feb 2024 19:40:01 +0100
Subject: [PATCH] Support Exiv2 0.28+

Use the new types for the image pointer and exception class as available
in the new Exiv2 version, keeping the support for older versions.
---
 Tokenize/filters/Exiv2ImageFilter.cc | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Tokenize/filters/Exiv2ImageFilter.cc 
b/Tokenize/filters/Exiv2ImageFilter.cc
index ceac398..6b685b3 100644
--- a/Tokenize/filters/Exiv2ImageFilter.cc
+++ b/Tokenize/filters/Exiv2ImageFilter.cc
@@ -26,6 +26,7 @@
 #include <exiv2/image.hpp>
 #include <exiv2/exif.hpp>
 #include <exiv2/iptc.hpp>
+#include <exiv2/version.hpp>
 #ifdef HAVE_EXIV2_XMP_EXIV2_HPP
 #include <exiv2/xmp_exiv2.hpp>
 #include <exiv2/error.hpp>
@@ -236,7 +237,11 @@ bool Exiv2ImageFilter::next_document(void)
 
        try
        {
+#if EXIV2_TEST_VERSION(0,28,0)
+               Exiv2::Image::UniquePtr image = 
Exiv2::ImageFactory::open(m_filePath);
+#else
                Exiv2::Image::AutoPtr image = 
Exiv2::ImageFactory::open(m_filePath);
+#endif
                if (image.get() == NULL)
                {
                        clog << m_filePath.c_str() << " is not an image" << 
endl;
@@ -388,7 +393,11 @@ bool Exiv2ImageFilter::next_document(void)
                        }
                }
        }
+#if EXIV2_TEST_VERSION(0,28,0)
+       catch (Exiv2::Error &e)
+#else
        catch (Exiv2::AnyError &e)
+#endif
        {
                clog << "Caught exiv2 exception: " << e << endl;
                foundData = false;
-- 
2.43.0

Reply via email to