Package: gpscorrelate
Version: 1.5.6-1+b2
Followup-For: Bug #473362

Hello,

I wrote a gpscorrelate commandline generator that uses a picture of the
GPS display as a reference for the time offset: please find it attached
to this mail.  Consider it released under the WTFPL version 2 as found
at http://sam.zoy.org/wtfpl/

It needs python-exiv2 to work.


Ciao,

Enrico

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages gpscorrelate depends on:
ii  libc6                      2.7-13        GNU C Library: Shared libraries
ii  libexiv2-4                 0.17.1-1      EXIF/IPTC metadata manipulation li
ii  libgcc1                    1:4.3.2-1     GCC support library
ii  libstdc++6                 4.3.2-1       The GNU Standard C++ Library v3
ii  libxml2                    2.6.32.dfsg-4 GNOME XML library

gpscorrelate recommends no packages.

gpscorrelate suggests no packages.

-- no debconf information
#!/usr/bin/python

import pyexiv2
import datetime
import sys

gpxfile = sys.argv[1]
pivotimg = sys.argv[2]
gpstime = datetime.datetime.strptime(sys.argv[3], "%Y-%m-%d %H:%M:%S")

pimg = pyexiv2.Image(pivotimg)
pimg.readMetadata()
exiftime = pimg['Exif.Image.DateTime']

diff = exiftime - gpstime
if diff.days > 0:
    raise RuntimeError, "Time difference is %d days" % diff.days
diff = diff.seconds
hours = int(round(float(diff) / 3600.0))
seconds = diff - hours*3600

if hours >= 0:
    timeadd = "+%d" % hours
else:
    timeadd = "%d" % hours

print "gpscorrelate -g %s --timeadd %s --photooffset %d --no-write" % (
    gpxfile, timeadd, seconds)

Reply via email to