[tracker/tracker-0.12] Writeback N/E/S/W notation for GPS coordinates
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.12] Writeback N/E/S/W notation for GPS coordinates
- Date: Fri, 25 Nov 2011 15:45:16 +0000 (UTC)
commit ae6bb5fe5df18d4296aa73d949877bbd447090c9
Author: Philip Van Hoof <philip codeminded be>
Date: Tue Nov 15 13:41:27 2011 +0100
Writeback N/E/S/W notation for GPS coordinates
Fixes NB#291088.
src/tracker-writeback/tracker-writeback-xmp.c | 30 +++++++++++++++++++++++-
1 files changed, 28 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-writeback/tracker-writeback-xmp.c b/src/tracker-writeback/tracker-writeback-xmp.c
index c3e3ed8..1b91b2e 100644
--- a/src/tracker-writeback/tracker-writeback-xmp.c
+++ b/src/tracker-writeback/tracker-writeback-xmp.c
@@ -501,12 +501,38 @@ writeback_xmp_update_file_metadata (TrackerWritebackFile *wbf,
xmp_delete_property (xmp, NS_EXIF, "GPSLongitude");
if (longitude != NULL) {
- xmp_set_property (xmp, NS_EXIF, "GPSLongitude", longitude, 0);
+ double coord = atof (longitude);
+ double degrees, minutes;
+ gchar *val;
+
+ minutes = modf (coord, °rees);
+
+ val = g_strdup_printf ("%3d,%f%c",
+ (int) fabs(degrees),
+ minutes,
+ coord >= 0 ? 'E' : 'W');
+
+ xmp_set_property (xmp, NS_EXIF, "GPSLongitude", val, 0);
+
+ g_free (val);
}
xmp_delete_property (xmp, NS_EXIF, "GPSLatitude");
if (latitude != NULL) {
- xmp_set_property (xmp, NS_EXIF, "GPSLatitude", latitude, 0);
+ double coord = atof (latitude);
+ double degrees, minutes;
+ gchar *val;
+
+ minutes = modf (coord, °rees);
+
+ val = g_strdup_printf ("%3d,%f%c",
+ (int) fabs(degrees),
+ minutes,
+ coord >= 0 ? 'N' : 'S');
+
+ xmp_set_property (xmp, NS_EXIF, "GPSLatitude", val, 0);
+
+ g_free (val);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]