mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Check if img coords existsd
This commit is contained in:
parent
f8b6575ef4
commit
ab41cd67a8
1 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue