1 This patch allows us to build libextractor against exiv2 0.27.x.
2 Adapted from this upstream commit:
4 commit 1ecee9a47717e36cb8a3925d011d1a6de11d631c
5 Author: Christian Grothoff <christian@grothoff.org>
6 Date: Mon Jul 29 17:58:18 2019 +0200
8 importing patch from Gentoo/AS to address exiv2 build issue (#5820)
10 diff --git a/src/plugins/exiv2_extractor.cc b/src/plugins/exiv2_extractor.cc
11 index 8741d40..ef402a8 100644
12 --- a/src/plugins/exiv2_extractor.cc
13 +++ b/src/plugins/exiv2_extractor.cc
18 -#include <exiv2/exif.hpp>
19 -#include <exiv2/error.hpp>
20 -#include <exiv2/image.hpp>
21 -#include <exiv2/futils.hpp>
22 +#include <exiv2/exiv2.hpp>
25 * Enable debugging to get error messages.
26 @@ -180,7 +177,7 @@ public:
30 -#if EXIV2_VERSION >= EXIV2_MAKE_VERSION(0,26,0)
31 +#if EXIV2_TEST_VERSION(0,26,0)
32 virtual size_t size (void) const;
34 virtual long int size (void) const;
35 @@ -316,7 +313,11 @@ ExtractorIO::getb ()
36 const unsigned char *r;
38 if (1 != ec->read (ec->cls, &data, 1))
39 +#if EXIV2_TEST_VERSION(0,27,0)
40 + throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
42 throw Exiv2::BasicError<char> (42 /* error code */);
44 r = (const unsigned char *) data;
47 @@ -371,7 +372,11 @@ ExtractorIO::putb (Exiv2::byte data)
49 ExtractorIO::transfer (Exiv2::BasicIo& src)
51 +#if EXIV2_TEST_VERSION(0,27,0)
52 + throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
54 throw Exiv2::BasicError<char> (42 /* error code */);
59 @@ -416,7 +421,11 @@ ExtractorIO::seek (long offset,
61 ExtractorIO::mmap (bool isWritable)
63 +#if EXIV2_TEST_VERSION(0,27,0)
64 + throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
66 throw Exiv2::BasicError<char> (42 /* error code */);
71 @@ -449,7 +458,7 @@ ExtractorIO::tell (void) const
75 -#if EXIV2_VERSION >= EXIV2_MAKE_VERSION(0,26,0)
76 +#if EXIV2_TEST_VERSION(0,26,0)
80 @@ -504,7 +513,11 @@ ExtractorIO::eof () const
82 ExtractorIO::path () const
84 +#if EXIV2_TEST_VERSION(0,27,0)
85 + throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
87 throw Exiv2::BasicError<char> (42 /* error code */);
92 @@ -517,7 +530,11 @@ ExtractorIO::path () const
94 ExtractorIO::wpath () const
96 +#if EXIV2_TEST_VERSION(0,27,0)
97 + throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
99 throw Exiv2::BasicError<char> (42 /* error code */);
104 @@ -531,7 +548,11 @@ Exiv2::BasicIo::AutoPtr
105 ExtractorIO::temporary () const
107 fprintf (stderr, "throwing temporary error\n");
108 +#if EXIV2_TEST_VERSION(0,27,0)
109 + throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
111 throw Exiv2::BasicError<char> (42 /* error code */);
116 @@ -697,7 +718,7 @@ EXTRACTOR_exiv2_extract_method (struct EXTRACTOR_ExtractContext *ec)
120 -#if EXIV2_MAKE_VERSION(0,23,0) <= EXIV2_VERSION
121 +#if !EXIV2_TEST_VERSION(0,24,0)
122 Exiv2::LogMsg::setLevel (Exiv2::LogMsg::mute);
124 std::auto_ptr<Exiv2::BasicIo> eio(new ExtractorIO (ec));