kde-frameworks/kfilemetadata: Fix build with >=exiv2-0.28

Closes: https://bugs.gentoo.org/906090
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
Andreas Sturmlechner
2023-05-20 18:59:35 +02:00
parent 2d77958962
commit 3992bff641
2 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
From 6fcce03cfd85fffbe6d7701506de49c5987fdbe5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@lindev.ch>
Date: Thu, 18 May 2023 02:03:56 +0200
Subject: [PATCH] Fix build with exiv2 >= 0.28
---
src/extractors/exiv2extractor.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/extractors/exiv2extractor.cpp b/src/extractors/exiv2extractor.cpp
index d39247b9..469a6325 100644
--- a/src/extractors/exiv2extractor.cpp
+++ b/src/extractors/exiv2extractor.cpp
@@ -75,7 +75,11 @@ QVariant toVariantDateTime(const Exiv2::Value& value)
QVariant toVariantLong(const Exiv2::Value& value)
{
if (value.typeId() == Exiv2::unsignedLong || value.typeId() == Exiv2::signedLong) {
+#if EXIV2_TEST_VERSION(0,28,0)
+ qlonglong val = value.toInt64();
+#else
qlonglong val = value.toLong();
+#endif
return QVariant(val);
}
@@ -310,7 +314,11 @@ double Exiv2Extractor::fetchGpsAltitude(const Exiv2::ExifData& data)
it = data.findKey(Exiv2::ExifKey("Exif.GPSInfo.GPSAltitudeRef"));
if (it != data.end() && it->count() > 0 &&
(it->value().typeId() == Exiv2::unsignedByte || it->value().typeId() == Exiv2::signedByte)) {
+#if EXIV2_TEST_VERSION(0,28,0)
+ auto altRef = it->value().toInt64();
+#else
auto altRef = it->value().toLong();
+#endif
if (altRef) {
alt = -1.0 * ratio.first / ratio.second;
} else {
--
GitLab

View File

@@ -33,6 +33,8 @@ DEPEND="${RDEPEND}
"
BDEPEND="test? ( ${PYTHON_DEPS} )"
PATCHES=( "${FILESDIR}/${P}-exiv2-0.28.patch" ) # bug 906090
pkg_setup() {
use test && python-any-r1_pkg_setup
ecm_pkg_setup