Package: gpscorrelate
Version: 1.6.0-1+b1
Severity: normal
Tags: patch, upstream
Hello. I'm sending this bug report to both the Debian BTS and upstream
author since I encountered the problem using the gpscorrelate package
from Debian, but I think it is also present in the upstream version.
Specifically, I believe that the value for the GPSDateStamp tag, that
is added by gpscorrelate to an image, is stored using the wrong data
type. The Exif 2.2 standard (section 4.6.6) specifies that the date
should be stored as a character string of the form "YYYY:MM:DD", while
looking at the output from the program exiftool[1], for example,
indicates that the date isn't stored in this format. Consider for
example the output from the following commands:
$ gpscorrelate -M -z 2 -g track.gpx test.jpg
[Output snipped]
$ exiftool -S -GPSDateTime -GPSDateStamp test.jpg
GPSDateTime: 2009 4 18 13:16:45
GPSDateStamp: 2009 4 18
This becomes somewhat more apparent if I try to use exiftool to print
the GPS date stamp in another format, for example according to ISO 8601:
$ exiftool -S -d '%Y-%m-%d -GPSDateTime -GPSDateStamp test.jpg
GPSDateTime: 2009 4 18 13:16:45
GPSDateStamp: 2009 4 18
The output is unchanged, so I assume exiftool doesn't understand the
value of GPSDateStamp and thus cannot convert the date to the
requested the format. I've attached a patch which I think will correct
the problem, and, if applied, when I rerun gpscorrelate on the image
and then use exiftool to read the GPS date stamp, exiftool will
indeed print it in the requested format:
$ gpscorrelate.patched -r test.jpg
[Output snipped]
$ gpscorrelate.patched -M -z 2 -g track.gpx test.jpg
[Output snipped]
$ exiftool -S -d '%Y-%m-%d -GPSDateTime -GPSDateStamp test.jpg
GPSDateTime: 2009-04-18
GPSDateStamp: 2009:04:18
[1] http://www.sno.phy.queensu.ca/~phil/exiftool/
http://packages.debian.org/sid/libimage-exiftool-perl
-- System Information:
Debian Release: 5.0
APT prefers unstable
APT policy: (990, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash
Versions of packages gpscorrelate depends on:
ii libc6 2.9-4 GNU C Library: Shared libraries
ii libexiv2-5 0.18.1-1 EXIF/IPTC metadata manipulation li
ii libgcc1 1:4.3.3-3 GCC support library
ii libstdc++6 4.3.3-3 The GNU Standard C++ Library v3
ii libxml2 2.6.32.dfsg-5 GNOME XML library
gpscorrelate recommends no packages.
gpscorrelate suggests no packages.
-- no debconf information
--- a/exif-gps.cpp 2009-04-05 01:08:45.000000000 +0000
+++ b/exif-gps.cpp 2009-05-17 22:20:20.000000000 +0000
@@ -628,13 +628,11 @@
ExifToWrite.add(Exiv2::ExifKey("Exif.GPSInfo.GPSTimeStamp"), Value.get());
// And we should also do a datestamp.
- Value = Exiv2::Value::create(Exiv2::signedRational);
- snprintf(ScratchBuf, 100, "%d/1 %d/1 %d/1",
+ snprintf(ScratchBuf, 100, "%04d:%02d:%02d",
TimeStamp.tm_year + 1900,
TimeStamp.tm_mon + 1,
TimeStamp.tm_mday);
- Value->read(ScratchBuf);
- ExifToWrite.add(Exiv2::ExifKey("Exif.GPSInfo.GPSDateStamp"), Value.get());
+ ExifToWrite["Exif.GPSInfo.GPSDateStamp"] = ScratchBuf;
// Write the data to file.
Image->writeMetadata();