pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/graphics/gwenview
Module Name: pkgsrc
Committed By: mrg
Date: Sat Jul 8 20:35:19 UTC 2023
Modified Files:
pkgsrc/graphics/gwenview: distinfo
Added Files:
pkgsrc/graphics/gwenview/patches: patch-lib_jpegcontent.cpp
Log Message:
fix build with exiv2 0.28.
from upstream commit a7275c90bf51a352783c723116a716af419896f4
Subject: [PATCH] Fix build with exiv2 >= 0.28
thanks to wiz for pointing to this patch.
To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 pkgsrc/graphics/gwenview/distinfo
cvs rdiff -u -r0 -r1.3 \
pkgsrc/graphics/gwenview/patches/patch-lib_jpegcontent.cpp
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/graphics/gwenview/distinfo
diff -u pkgsrc/graphics/gwenview/distinfo:1.37 pkgsrc/graphics/gwenview/distinfo:1.38
--- pkgsrc/graphics/gwenview/distinfo:1.37 Thu Sep 29 00:53:10 2022
+++ pkgsrc/graphics/gwenview/distinfo Sat Jul 8 20:35:19 2023
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.37 2022/09/29 00:53:10 markd Exp $
+$NetBSD: distinfo,v 1.38 2023/07/08 20:35:19 mrg Exp $
BLAKE2s (gwenview-22.08.1.tar.xz) = a22f10dfcdee6b8a284265eb1ee11114822254b8c02bd097d0abb13cf48206d6
SHA512 (gwenview-22.08.1.tar.xz) = 805d6e505cd74b731d01ba3930010e5bb46bd972741a7bc529f78d56bd3088e508757c61a58c2f147b4e2fbaca034d58590f59151080052e7d750e1f3e16ab6f
Size (gwenview-22.08.1.tar.xz) = 6825004 bytes
+SHA1 (patch-lib_jpegcontent.cpp) = 91d3403c99347dfed6c789797353d8224492f69e
Added files:
Index: pkgsrc/graphics/gwenview/patches/patch-lib_jpegcontent.cpp
diff -u /dev/null pkgsrc/graphics/gwenview/patches/patch-lib_jpegcontent.cpp:1.3
--- /dev/null Sat Jul 8 20:35:19 2023
+++ pkgsrc/graphics/gwenview/patches/patch-lib_jpegcontent.cpp Sat Jul 8 20:35:19 2023
@@ -0,0 +1,85 @@
+$NetBSD: patch-lib_jpegcontent.cpp,v 1.3 2023/07/08 20:35:19 mrg Exp $
+
+From a7275c90bf51a352783c723116a716af419896f4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero%lindev.ch@localhost>
+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 lib/jpegcontent.cpp lib/jpegcontent.cpp
+index 284fb6e61..286333f69 100644
+--- lib/jpegcontent.cpp
++++ lib/jpegcontent.cpp
+@@ -301,7 +301,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
+@@ -321,7 +325,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 = QStringLiteral("Exif.Image.") + keyName;
+ Exiv2::ExifKey keyResolution(keyVal.toLocal8Bit().data());
+ it = d->mExifData.findKey(keyResolution);
+@@ -337,9 +345,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;
+@@ -568,15 +584,24 @@ QImage JpegContent::thumbnail() const
+ auto it = d->mExifData.findKey(Exiv2::ExifKey("Exif.Canon.ThumbnailImageValidArea"));
+ // ensure ThumbnailImageValidArea actually specifies a rectangle, i.e. there must be 4 coordinates
+ if (it != d->mExifData.end() && it->count() == 4) {
++#if EXIV2_TEST_VERSION(0,28,0)
++ QRect validArea(QPoint(it->toUint32(0), it->toUint32(2)), QPoint(it->toUint32(1), it->toUint32(3)));
++#else
+ QRect validArea(QPoint(it->toLong(0), it->toLong(2)), QPoint(it->toLong(1), it->toLong(3)));
++#endif
+ image = image.copy(validArea);
+ } else {
+ // Unfortunately, Sony does not provide an exif tag that specifies the valid area of the
+ // embedded thumbnail. Need to derive it from the size of the preview image instead.
+ it = d->mExifData.findKey(Exiv2::ExifKey("Exif.Sony1.PreviewImageSize"));
+ if (it != d->mExifData.end() && it->count() == 2) {
++#if EXIV2_TEST_VERSION(0,28,0)
++ const long prevHeight = it->toUint32(0);
++ const long prevWidth = it->toUint32(1);
++#else
+ const long prevHeight = it->toLong(0);
+ const long prevWidth = it->toLong(1);
++#endif
+
+ if (image.width() > 0 && prevWidth > 0) {
+ const double scale = prevWidth / image.width();
+--
+GitLab
+
Home |
Main Index |
Thread Index |
Old Index