#include <ctype.h>
#include <math.h>
#include <glib/gi18n.h>
+#include <glib/gstdio.h>
#include <libexif/exif-data.h>
#include "libjpeg/jpeg-data.h"
//if ( ! ( ee->data[0] == 2 && ee->data[2] == 0 && ee->data[3] == 0 ) )
// goto MyReturn;
-
- ee = exif_content_get_entry (ed->ifd[EXIF_IFD_GPS], EXIF_TAG_GPS_MAP_DATUM);
- if ( ! ( ee && ee->components > 0 && ee->format == EXIF_FORMAT_ASCII ) )
- goto MyReturn;
-
- // If map datum specified - only deal in WGS-84 - the defacto standard
- if ( ee && ee->components > 0 ) {
- exif_entry_get_value ( ee, str, 128 );
- if ( strncmp (str, "WGS-84", 6) )
- goto MyReturn;
- }
-
//
// Lat & Long is necessary to form a waypoint.
//
if ( !ed )
return datetime;
+ // Also allows us to remember what directory we where using
+ gchar *dir = g_path_get_dirname ( filename );
+ if ( dir ) {
+ if ( g_chdir ( dir ) ) {
+ g_warning ( "Could not change directory to %s", dir );
+ }
+ g_free (dir);
+ }
+
gchar str[128];
ExifEntry *ee;