File Fix-building-against-exiv2-0.27.patch of Package libkexiv2-kde4

diff --git a/libkexiv2/kexiv2.cpp b/libkexiv2/kexiv2.cpp
index 04c4aa4..b7bbc1a 100644
--- a/libkexiv2/kexiv2.cpp
+++ b/libkexiv2/kexiv2.cpp
@@ -178,7 +178,7 @@ QString KExiv2::Exiv2Version()
     // Since 0.14.0 release, we can extract run-time version of Exiv2.
     // else we return make version.
 
-    return QString(Exiv2::version());
+    return QString(Exiv2::versionString().c_str());
 }
 
 QString KExiv2::version()
diff --git a/libkexiv2/kexiv2_p.cpp b/libkexiv2/kexiv2_p.cpp
index cb6b134..2a287ab 100644
--- a/libkexiv2/kexiv2_p.cpp
+++ b/libkexiv2/kexiv2_p.cpp
@@ -100,24 +100,14 @@ bool KExiv2::Private::saveToFile(const QFileInfo& finfo) const
 
     QStringList rawTiffBasedSupported, rawTiffBasedNotSupported;
 
-    // Raw files supported by Exiv2 0.21
-    rawTiffBasedSupported << "dng" << "nef" << "pef" << "orf" << "srw";
+    // Raw files supported by Exiv2 0.23
+    rawTiffBasedSupported << "dng" << "nef" << "pef" << "orf" << "srw" << "cr2";
 
-    if (Exiv2::testVersion(0,23,0))
-    {
-        rawTiffBasedSupported << "cr2";
-    }
-
-    // Raw files not supported by Exiv2 0.21
+    // Raw files not supported by Exiv2 0.23
     rawTiffBasedNotSupported
         << "3fr" << "arw" << "dcr" << "erf" << "k25" << "kdc" 
         << "mos" << "raw" << "sr2" << "srf" << "rw2";
 
-    if (!Exiv2::testVersion(0,23,0))
-    {
-        rawTiffBasedNotSupported << "cr2";
-    }
-
     QString ext = finfo.suffix().toLower();
 
     if (!writeRawFiles && (rawTiffBasedSupported.contains(ext) || rawTiffBasedNotSupported.contains(ext)) )
diff --git a/libkexiv2/kexiv2_p.h b/libkexiv2/kexiv2_p.h
index ddf8f6d..be90bf5 100644
--- a/libkexiv2/kexiv2_p.h
+++ b/libkexiv2/kexiv2_p.h
@@ -61,17 +61,7 @@
 #pragma GCC visibility push(default)
 #endif
 
-#include <exiv2/exv_conf.h>
-#include <exiv2/error.hpp>
-#include <exiv2/image.hpp>
-#include <exiv2/jpgimage.hpp>
-#include <exiv2/datasets.hpp>
-#include <exiv2/tags.hpp>
-#include <exiv2/preview.hpp>
-#include <exiv2/properties.hpp>
-#include <exiv2/types.hpp>
-#include <exiv2/exif.hpp>
-#include <exiv2/xmpsidecar.hpp>
+#include <exiv2/exiv2.hpp>
 
 // Check if Exiv2 support XMP
 
@@ -79,17 +69,6 @@
 #   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) \
-         ( 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.
 // See Exiv2 bugzilla entry http://dev.exiv2.org/issues/719
 // and wiki topic           http://dev.exiv2.org/boards/3/topics/583
diff --git a/libkexiv2/kexiv2exif.cpp b/libkexiv2/kexiv2exif.cpp
index 11c8948..52cd1a4 100644
--- a/libkexiv2/kexiv2exif.cpp
+++ b/libkexiv2/kexiv2exif.cpp
@@ -987,7 +987,11 @@ bool KExiv2::setTiffThumbnail(const QImage& thumbImage, bool setProgramName) con
 
         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
openSUSE Build Service is sponsored by