Bug#683772: gpscorrelate: provide a --force option to overwrite existing GPS tags

2017-10-16 Thread Tim Connors
Hi Mònica,

A patch has been supplied for this bug a long time ago, but hasn't been
acknowledged yet. Are you able to look at this please?

-- 
Tim Connors



Bug#683772: gpscorrelate: provide a --force option to overwrite existing GPS tags

2013-05-02 Thread Toby Speight
Tags: patch

I finally got around to doing this myself - please consider adding or
upstreaming this patch:

diff -r -u gpscorrelate-1.6.1/correlate.c gpscorrelate-1.6.1+tms.1/correlate.c
--- gpscorrelate-1.6.1/correlate.c	2007-06-21 15:31:49.0 +0100
+++ gpscorrelate-1.6.1+tms.1/correlate.c	2013-04-26 09:45:25.464853539 +0100
@@ -60,7 +60,7 @@
 		Options-Result = CORR_NOEXIFINPUT;
 		return 0;
 	}
-	if (IncludesGPS)
+	if (IncludesGPS  !Options-OverwriteExisting)
 	{
 		/* Already have GPS data in the file!
 		 * So we can't do this again... */
diff -r -u gpscorrelate-1.6.1/correlate.h gpscorrelate-1.6.1+tms.1/correlate.h
--- gpscorrelate-1.6.1/correlate.h	2007-06-21 15:31:49.0 +0100
+++ gpscorrelate-1.6.1+tms.1/correlate.h	2013-04-26 09:44:12.656247487 +0100
@@ -29,6 +29,7 @@
  * Not really sure if this is needed, but... */
 struct CorrelateOptions {
 	int NoWriteExif;
+	int OverwriteExisting;
 	int NoInterpolate;
 	int NoChangeMtime;
 	int TimeZoneHours;  /* To add to photos to make them UTC. */
diff -r -u gpscorrelate-1.6.1/debian/changelog gpscorrelate-1.6.1+tms.1/debian/changelog
--- gpscorrelate-1.6.1/debian/changelog	2012-05-06 23:28:10.0 +0100
+++ gpscorrelate-1.6.1+tms.1/debian/changelog	2013-04-26 10:30:33.559152896 +0100
@@ -1,3 +1,9 @@
+gpscorrelate (1.6.1-4+tms.1) unstable; urgency=low
+
+  * Add ability to force overwriting of existing tags
+
+ -- Toby Speight t.m.speight...@cantab.net  Fri, 26 Apr 2013 09:31:14 +0100
+
 gpscorrelate (1.6.1-4) unstable; urgency=low
 
   * Update Maintainer field with Debian email.
diff -r -u gpscorrelate-1.6.1/doc/command.html gpscorrelate-1.6.1+tms.1/doc/command.html
--- gpscorrelate-1.6.1/doc/command.html	2007-06-21 15:31:49.0 +0100
+++ gpscorrelate-1.6.1+tms.1/doc/command.html	2013-04-26 10:14:59.547518455 +0100
@@ -54,6 +54,13 @@
 
 tr
 td valign=top nowrap=nowrap
+b--force or -F/b
+/tdtd
+Overwrite any existing GPS EXIF tags in the file. Without this option, image files that already have GPS tags are not modified.  Setting this option will never cause tags to be removed; use -r for that.
+/td/tr
+
+tr
+td valign=top nowrap=nowrap
 b--datum or -d datum/b
 /tdtd
 Specifies the datum to write into the GPS EXIF tags. By default, it is WGS-84. However, GPX is not supposed to store anything but WGS-84, so use if you must.
diff -r -u gpscorrelate-1.6.1/doc/gpscorrelate-manpage.xml.in gpscorrelate-1.6.1+tms.1/doc/gpscorrelate-manpage.xml.in
--- gpscorrelate-1.6.1/doc/gpscorrelate-manpage.xml.in	2008-10-31 11:50:39.0 +
+++ gpscorrelate-1.6.1+tms.1/doc/gpscorrelate-manpage.xml.in	2013-04-26 09:56:46.094513109 +0100
@@ -77,6 +77,11 @@
 arg choice=plain-n/arg
 arg choice=plain--no-write/arg
   /group
+  
+  group
+arg choice=plain-F/arg
+arg choice=plain--force/arg
+  /group
 
   group
 arg choice=plain-m/arg
@@ -297,6 +302,16 @@
 /listitem
   /varlistentry
 
+  varlistentry
+term
+  option-F/option,
+  option--force/option
+/term
+listitem
+  paraoverwrite existing GPS tags/para
+/listitem
+  /varlistentry
+
   varlistentry
 term
   option-m/option,
diff -r -u gpscorrelate-1.6.1/doc/gui.html gpscorrelate-1.6.1+tms.1/doc/gui.html
--- gpscorrelate-1.6.1/doc/gui.html	2007-06-21 15:31:49.0 +0100
+++ gpscorrelate-1.6.1+tms.1/doc/gui.html	2013-04-26 10:13:34.086815903 +0100
@@ -28,6 +28,8 @@
 
 pThe bDon't write/b checkbox, if checked, will prevent the GPS EXIF tags being written back to the photo. However, the point that is matched will be shown in the list, which allows you to correlate and check the results first./p
 
+pThe bOverwrite existing tags/b checkbox, if checked, will make matches replace any existing tags.  Without this option, files that already have GPS tags will not be touched.  Unmatched files will not be modified, regardless of this setting./p
+
 pThe bDon't change mtime/b checkbox, if checked, will prevent changes to the JPEG files from updating the files mtime./p
 
 pThe bBetween Segments/b checkbox, if checked, will ignore track segments, and match photos between track segments. Usually a track segment differentiates between multiple GPS data logging sessions, so interpolating between track segments could well be interpolating when there was no GPS data./p
diff -r -u gpscorrelate-1.6.1/exif-gps.cpp gpscorrelate-1.6.1+tms.1/exif-gps.cpp
--- gpscorrelate-1.6.1/exif-gps.cpp	2013-05-02 17:44:42.0 +0100
+++ gpscorrelate-1.6.1+tms.1/exif-gps.cpp	2013-04-26 11:02:11.142842258 +0100
@@ -434,6 +434,15 @@
 
 }
 
+void replace(Exiv2::ExifData exif, Exiv2::ExifKey key, const Exiv2::Value *value)
+{
+Exiv2::ExifData::iterator it = exif.findKey(key);
+if (it != exif.end())
+it-setValue(value);
+else
+exif.add(key, value);
+}
+
 int WriteGPSData(char* File, struct GPSPoint* Point, char* Datum, int NoChangeMtime, int 

Bug#683772: gpscorrelate: provide a --force option to overwrite existing GPS tags

2013-05-02 Thread Daniel Foote
Hello,

Dan Fandrich (d...@coneharvesters.com) has taken over maintenance of
gpscorrelate. I've forwarded your patch on to him.

Thankyou,

Daniel Foote.


On Fri, May 3, 2013 at 12:57 AM, Toby Speight t.m.speight...@cantab.netwrote:

 Tags: patch

 I finally got around to doing this myself - please consider adding or
 upstreaming this patch:




Bug#683772: gpscorrelate: provide a --force option to overwrite existing GPS tags

2012-08-03 Thread Toby Speight
Package: gpscorrelate
Version: 1.6.1-4
Severity: wishlist

I've recently acquired a camera that writes GPS data to its images.
But the positioning data are quite often a bit off, because it only
infrequently updates itself (to conserve battery, I presume).

Therefore, I want to overwrite the image data with a GPS position
taken from my separate recorder, if that was on at the time of the
photo.

I could use a two-pass approach, using the -r option, but that would
mean that I'd completely lose geodata where it's not present in the
tracklog.  Which is undesirable, really.

N.B. the GPSDateTime records the time of acquisition of geodata, and
 can be minutes behind Date/Time Original; I think the camera
 interpolates but haven't checked.


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (900, 'testing'), (900, 'stable'), (400, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
armel

Kernel: Linux 3.2.9-balti (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gpscorrelate depends on:
ii  libc62.13-33
ii  libexiv2-12  0.23-1
ii  libgcc1  1:4.7.1-2
ii  libstdc++6   4.7.1-2
ii  libxml2  2.8.0+dfsg1-5

gpscorrelate recommends no packages.

gpscorrelate suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org