File Fix-build-with-exiv2_0.28.patch of Package gwenview4
From a7275c90bf51a352783c723116a716af419896f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@lindev.ch>
Date: Sun, 21 May 2023 01:09:59 +0200
Subject: [PATCH] Fix build with exiv2 >= 0.28
---
lib/jpegcontent.cpp | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/lib/jpegcontent.cpp b/lib/jpegcontent.cpp
index 284fb6e61..286333f69 100644
--- a/lib/jpegcontent.cpp
+++ b/lib/jpegcontent.cpp
@@ -276,7 +276,11 @@ Orientation JpegContent::orientation() const
if (it == d->mExifData.end() || it->count() == 0 || it->typeId() != Exiv2::unsignedShort) {
return NOT_AVAILABLE;
}
+#if EXIV2_TEST_VERSION(0,28,0)
+ return Orientation(it->toUint32());
+#else
return Orientation(it->toLong());
+#endif
}
int JpegContent::dotsPerMeterX() const
@@ -296,7 +300,11 @@ int JpegContent::dotsPerMeter(const QString& keyName) const
if (it == d->mExifData.end()) {
return 0;
}
+#if EXIV2_TEST_VERSION(0,28,0)
+ int res = it->toUint32();
+#else
int res = it->toLong();
+#endif
QString keyVal = "Exif.Image." + keyName;
Exiv2::ExifKey keyResolution(keyVal.toAscii().data());
it = d->mExifData.findKey(keyResolution);
@@ -312,9 +320,17 @@ int JpegContent::dotsPerMeter(const QString& keyName) const
const float INCHESPERMETER = (100. / 2.54);
switch (res) {
case 3: // dots per cm
+#if EXIV2_TEST_VERSION(0,28,0)
+ return int(it->toUint32() * 100);
+#else
return int(it->toLong() * 100);
+#endif
default: // dots per inch
+#if EXIV2_TEST_VERSION(0,28,0)
+ return int(it->toUint32() * INCHESPERMETER);
+#else
return int(it->toLong() * INCHESPERMETER);
+#endif
}
return 0;
--
GitLab