mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +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;
|
private double decLatitude, decLongitude;
|
||||||
Context context;
|
Context context;
|
||||||
private static final String TAG = GPSExtractor.class.getName();
|
private static final String TAG = GPSExtractor.class.getName();
|
||||||
|
public boolean imageCoordsExists;
|
||||||
|
|
||||||
public GPSExtractor(String filePath, Context context){
|
public GPSExtractor(String filePath, Context context){
|
||||||
this.filePath = filePath;
|
this.filePath = filePath;
|
||||||
|
|
@ -39,6 +40,7 @@ public class GPSExtractor {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE) == null) {
|
if (exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE) == null) {
|
||||||
|
imageCoordsExists = false;
|
||||||
Log.d(TAG, "Picture has no GPS info");
|
Log.d(TAG, "Picture has no GPS info");
|
||||||
|
|
||||||
LocationManager locationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE);
|
LocationManager locationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE);
|
||||||
|
|
@ -51,6 +53,7 @@ public class GPSExtractor {
|
||||||
return currentCoords;
|
return currentCoords;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
imageCoordsExists = true;
|
||||||
latitude = exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE);
|
latitude = exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE);
|
||||||
latitude_ref = exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF);
|
latitude_ref = exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF);
|
||||||
longitude = exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE);
|
longitude = exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue