summaryrefslogtreecommitdiff
path: root/sci-geosciences/gpscorrelate/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-08-20 21:42:17 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-08-20 21:42:17 +0100
commit90a3be9d71a22834f9bc82c072f1b993f9a10e31 (patch)
tree7f86c1f37e857df29494ec91436ca76bed49441a /sci-geosciences/gpscorrelate/files
parenta597364520b9291d0b2a23bb007ced022e821d95 (diff)
gentoo auto-resync : 20:08:2023 - 21:42:17
Diffstat (limited to 'sci-geosciences/gpscorrelate/files')
-rw-r--r--sci-geosciences/gpscorrelate/files/gpscorrelate-2.0-exiv2-0.28.patch135
1 files changed, 135 insertions, 0 deletions
diff --git a/sci-geosciences/gpscorrelate/files/gpscorrelate-2.0-exiv2-0.28.patch b/sci-geosciences/gpscorrelate/files/gpscorrelate-2.0-exiv2-0.28.patch
new file mode 100644
index 000000000000..f15032fd7c77
--- /dev/null
+++ b/sci-geosciences/gpscorrelate/files/gpscorrelate-2.0-exiv2-0.28.patch
@@ -0,0 +1,135 @@
+From 7c945a5c9116325dad795dbe9682c2c4a4dea2d9 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Sun, 20 Aug 2023 18:57:43 +0200
+Subject: [PATCH] Fix build with >=exiv2-0.28
+
+Fixes https://github.com/dfandrich/gpscorrelate/issues/22
+
+Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
+---
+ exif-gps.cpp | 37 +++++++++++++++++++++++++++++++++++++
+ 1 file changed, 37 insertions(+)
+
+diff --git a/exif-gps.cpp b/exif-gps.cpp
+index d464d62..71b46ef 100644
+--- a/exif-gps.cpp
++++ b/exif-gps.cpp
+@@ -44,6 +44,7 @@
+ #include "exiv2/image.hpp"
+ #include "exiv2/exif.hpp"
+ #include "exiv2/error.hpp"
++#include "exiv2/version.hpp"
+
+ #include "gpsstructure.h"
+ #include "exif-gps.h"
+@@ -97,7 +98,11 @@ int main(int argc, char* argv[])
+ char* ReadExifDate(const char* File, int* IncludesGPS)
+ {
+ // Open and read the file.
++#if EXIV2_TEST_VERSION(0, 28, 0)
++ Exiv2::Image::UniquePtr Image;
++#else
+ Exiv2::Image::AutoPtr Image;
++#endif
+
+ try {
+ Image = Exiv2::ImageFactory::open(File);
+@@ -154,7 +159,11 @@ char* ReadExifData(const char* File, double* Lat, double* Long, double* Elev, in
+ // much more data than the last, specifically
+ // for display purposes. For the GUI version.
+ // Open and read the file.
++#if EXIV2_TEST_VERSION(0, 28, 0)
++ Exiv2::Image::UniquePtr Image;
++#else
+ Exiv2::Image::AutoPtr Image;
++#endif
+
+ try {
+ Image = Exiv2::ImageFactory::open(File);
+@@ -273,7 +282,11 @@ char* ReadExifData(const char* File, double* Lat, double* Long, double* Elev, in
+
+ // Is the altitude below sea level? If so, negate the value.
+ GPSData = ExifRead["Exif.GPSInfo.GPSAltitudeRef"];
++#if EXIV2_TEST_VERSION(0, 28, 0)
++ if (GPSData.count() >= 1 && GPSData.toUint32() == 1)
++#else
+ if (GPSData.count() >= 1 && GPSData.toLong() == 1)
++#endif
+ {
+ // Negate the elevation.
+ *Elev = -*Elev;
+@@ -292,7 +305,11 @@ char* ReadGPSTimestamp(const char* File, char* DateStamp, char* TimeStamp, int*
+ // much more data than the last, specifically
+ // for display purposes. For the GUI version.
+ // Open and read the file.
++#if EXIV2_TEST_VERSION(0, 28, 0)
++ Exiv2::Image::UniquePtr Image;
++#else
+ Exiv2::Image::AutoPtr Image;
++#endif
+
+ try {
+ Image = Exiv2::ImageFactory::open(File);
+@@ -463,7 +480,11 @@ int WriteGPSData(const char* File, const struct GPSPoint* Point,
+ struct utimbuf utb;
+ if (NoChangeMtime)
+ stat(File, &statbuf);
++#if EXIV2_TEST_VERSION(0, 28, 0)
++ Exiv2::Image::UniquePtr Image;
++#else
+ Exiv2::Image::AutoPtr Image;
++#endif
+
+ try {
+ Image = Exiv2::ImageFactory::open(File);
+@@ -493,7 +514,11 @@ int WriteGPSData(const char* File, const struct GPSPoint* Point,
+ // Do all the easy constant ones first.
+ // GPSVersionID tag: standard says it should be four bytes: 02 02 00 00
+ // (and, must be present).
++#if EXIV2_TEST_VERSION(0, 28, 0)
++ Exiv2::Value::UniquePtr Value = Exiv2::Value::create(Exiv2::unsignedByte);
++#else
+ Exiv2::Value::AutoPtr Value = Exiv2::Value::create(Exiv2::unsignedByte);
++#endif
+ Value->read("2 2 0 0");
+ replace(ExifToWrite, Exiv2::ExifKey("Exif.GPSInfo.GPSVersionID"), Value.get());
+ // Datum: the datum of the measured data. The default is WGS-84.
+@@ -643,7 +668,11 @@ int WriteFixedDatestamp(const char* File, time_t Time)
+ struct utimbuf utb;
+ stat(File, &statbuf);
+
++#if EXIV2_TEST_VERSION(0, 28, 0)
++ Exiv2::Image::UniquePtr Image;
++#else
+ Exiv2::Image::AutoPtr Image;
++#endif
+
+ try {
+ Image = Exiv2::ImageFactory::open(File);
+@@ -672,7 +701,11 @@ int WriteFixedDatestamp(const char* File, time_t Time)
+ ExifToWrite.erase(ExifToWrite.findKey(Exiv2::ExifKey("Exif.GPSInfo.GPSDateStamp")));
+ ExifToWrite["Exif.GPSInfo.GPSDateStamp"] = ScratchBuf;
+
++#if EXIV2_TEST_VERSION(0, 28, 0)
++ Exiv2::Value::UniquePtr Value = Exiv2::Value::create(Exiv2::unsignedRational);
++#else
+ Exiv2::Value::AutoPtr Value = Exiv2::Value::create(Exiv2::unsignedRational);
++#endif
+ snprintf(ScratchBuf, sizeof(ScratchBuf), "%d/1 %d/1 %d/1",
+ TimeStamp.tm_hour, TimeStamp.tm_min,
+ TimeStamp.tm_sec);
+@@ -705,7 +738,11 @@ int RemoveGPSExif(const char* File, int NoChangeMtime, int NoWriteExif)
+ stat(File, &statbuf);
+
+ // Open the file and start reading.
++#if EXIV2_TEST_VERSION(0, 28, 0)
++ Exiv2::Image::UniquePtr Image;
++#else
+ Exiv2::Image::AutoPtr Image;
++#endif
+
+ try {
+ Image = Exiv2::ImageFactory::open(File);
+--
+2.41.0
+