Package: gpscorrelate / 1.6.1-7

60-gpstimestamp-unsigned.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Description: Write the GPSTimeStamp tag as unsigned, as per spec.
             Use unsigned rationals for all EXIF values since that's 
             the only kind used by the GPS tags.
Author: Dan Fandrich <dan@coneharvesters.com>
Bug: https://bugs.debian.org/779390
Applied-Upstream: https://github.com/freefoote/gpscorrelate/commit/1fb96c97e728955a690f779dd2acca532af90f88
Last-Update: 2018-03-02

--- a/exif-gps.cpp
+++ b/exif-gps.cpp
@@ -215,7 +215,7 @@
 		//     -- / 3600 = result
 		//      v   
 		// Each part is added to the final number.
-		Exiv2::Rational RatNum;
+		Exiv2::URational RatNum;
 
 		GPSData = ExifRead["Exif.GPSInfo.GPSLatitude"];
 		if (GPSData.count() < 3)
@@ -339,9 +339,9 @@
 		// Seems to include GPS data...
 		*IncludesGPS = 1;
 
-		Exiv2::Rational RatNum1;
-		Exiv2::Rational RatNum2;
-		Exiv2::Rational RatNum3;
+		Exiv2::URational RatNum1;
+		Exiv2::URational RatNum2;
+		Exiv2::URational RatNum3;
 
 		// Read out the Time and Date stamp, for correction.
 		GPSData = ExifRead["Exif.GPSInfo.GPSTimeStamp"];
@@ -469,7 +469,7 @@
 	double FracPart;
 
 	// Do all the easy constant ones first.
-	// GPSVersionID tag: standard says is should be four bytes: 02 00 00 00
+	// GPSVersionID tag: standard says it should be four bytes: 02 00 00 00
 	//  (and, must be present).
 	Exiv2::Value::AutoPtr Value = Exiv2::Value::create(Exiv2::unsignedByte);
 	Value->read("2 0 0 0");
@@ -618,7 +618,7 @@
 		memcpy(&TimeStamp, tmp2, sizeof(struct tm));
 	}
 
-	Value = Exiv2::Value::create(Exiv2::signedRational);
+	Value = Exiv2::Value::create(Exiv2::unsignedRational);
 	snprintf(ScratchBuf, 100, "%d/1 %d/1 %d/1",
 			TimeStamp.tm_hour, TimeStamp.tm_min,
 			TimeStamp.tm_sec);
@@ -696,8 +696,8 @@
 	char ScratchBuf[100];
 
 	Exiv2::Value::AutoPtr Value;
-	Value = Exiv2::Value::create(Exiv2::signedRational);
-	snprintf(ScratchBuf, 100, "%d/1 %d/1 %d/1",
+	Value = Exiv2::Value::create(Exiv2::unsignedRational);
+	snprintf(ScratchBuf, sizeof(ScratchBuf), "%d/1 %d/1 %d/1",
 			TimeStamp.tm_year + 1900,
 			TimeStamp.tm_mon + 1,
 			TimeStamp.tm_mday);
@@ -705,8 +705,8 @@
 	ExifToWrite.erase(ExifToWrite.findKey(Exiv2::ExifKey("Exif.GPSInfo.GPSDateStamp")));
 	ExifToWrite.add(Exiv2::ExifKey("Exif.GPSInfo.GPSDateStamp"), Value.get());
 	
-	Value = Exiv2::Value::create(Exiv2::signedRational);
-	snprintf(ScratchBuf, 100, "%d/1 %d/1 %d/1",
+	Value = Exiv2::Value::create(Exiv2::unsignedRational);
+	snprintf(ScratchBuf, sizeof(ScratchBuf), "%d/1 %d/1 %d/1",
 			TimeStamp.tm_hour, TimeStamp.tm_min,
 			TimeStamp.tm_sec);
 	Value->read(ScratchBuf);