From 516128e999abbd57913b076dec019f899c07da3d Mon Sep 17 00:00:00 2001 From: Gilles Caulier Date: Sun, 7 Oct 2018 18:39:10 +0200 Subject: there is a mess in exiv2 headers 0.27.0, between version.hpp and exv_con.h We cannot use the macro defined in version.hpp to include this file... --- core/libs/dmetadata/metaengine_exif.cpp | 4 ++++ core/libs/dmetadata/metaengine_p.h | 18 ++++++------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/core/libs/dmetadata/metaengine_exif.cpp b/core/libs/dmetadata/metaengine_exif.cpp index 079fa96..73af582 100644 --- a/core/libs/dmetadata/metaengine_exif.cpp +++ b/core/libs/dmetadata/metaengine_exif.cpp @@ -995,7 +995,11 @@ bool MetaEngine::setTiffThumbnail(const QImage& thumbImage) const if (pos == d->exifMetadata().end() || pos->count() != 1 || pos->toLong() != 0) { +#if EXIV2_TEST_VERSION(0,27,0) + throw Exiv2::Error(Exiv2::kerErrorMessage, "Exif.Image.NewSubfileType missing or not set as main image"); +#else throw Exiv2::Error(1, "Exif.Image.NewSubfileType missing or not set as main image"); +#endif } // Remove sub-IFD tags diff --git a/core/libs/dmetadata/metaengine_p.h b/core/libs/dmetadata/metaengine_p.h index 9e234f2..157b63f 100644 --- a/core/libs/dmetadata/metaengine_p.h +++ b/core/libs/dmetadata/metaengine_p.h @@ -72,21 +72,19 @@ #include #include +#if (((EXIV2_MAJOR_VERSION) << 16) | ((EXIV2_MINOR_VERSION) << 8) | (EXIV2_PATCH_VERSION)) >= (((0) << 16) | ((27) << 8) | (0)) +# include +#endif + // Check if Exiv2 support XMP #ifdef EXV_HAVE_XMP_TOOLKIT # define _XMP_SUPPORT_ 1 #endif -// Make sure an EXIV2_TEST_VERSION macro exists: - -#ifdef EXIV2_VERSION -# ifndef EXIV2_TEST_VERSION -# define EXIV2_TEST_VERSION(major,minor,patch) \ +#ifndef EXIV2_TEST_VERSION +# define EXIV2_TEST_VERSION(major,minor,patch) \ ( EXIV2_VERSION >= EXIV2_MAKE_VERSION(major,minor,patch) ) -# endif -#else -# define EXIV2_TEST_VERSION(major,minor,patch) (false) #endif // With exiv2 > 0.20.0, all makernote header files have been removed to increase binary compatibility. -- cgit v1.1