From ab41cd67a85c7c449f795e87453a7598d895b6fe Mon Sep 17 00:00:00 2001 From: misaochan Date: Wed, 3 Feb 2016 15:54:30 +1300 Subject: [PATCH] Check if img coords existsd --- .../src/main/java/fr/free/nrw/commons/upload/GPSExtractor.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commons/src/main/java/fr/free/nrw/commons/upload/GPSExtractor.java b/commons/src/main/java/fr/free/nrw/commons/upload/GPSExtractor.java index 992a6e78c..df42f46ee 100644 --- a/commons/src/main/java/fr/free/nrw/commons/upload/GPSExtractor.java +++ b/commons/src/main/java/fr/free/nrw/commons/upload/GPSExtractor.java @@ -15,6 +15,7 @@ public class GPSExtractor { private double decLatitude, decLongitude; Context context; private static final String TAG = GPSExtractor.class.getName(); + public boolean imageCoordsExists; public GPSExtractor(String filePath, Context context){ this.filePath = filePath; @@ -39,6 +40,7 @@ public class GPSExtractor { } if (exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE) == null) { + imageCoordsExists = false; Log.d(TAG, "Picture has no GPS info"); LocationManager locationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE); @@ -51,6 +53,7 @@ public class GPSExtractor { return currentCoords; } else { + imageCoordsExists = true; latitude = exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE); latitude_ref = exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF); longitude = exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE);