mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Always return null if image has no EXIF data
This commit is contained in:
parent
0b0c01d3ac
commit
371580bf5e
1 changed files with 1 additions and 22 deletions
|
|
@ -121,28 +121,7 @@ public class GPSExtractor {
|
|||
|
||||
//If image has no EXIF data and user has enabled GPS setting, get user's location
|
||||
if (exif == null || exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE) == null) {
|
||||
if (useGPS) {
|
||||
registerLocationManager();
|
||||
|
||||
imageCoordsExists = false;
|
||||
Timber.d("EXIF data has no location info");
|
||||
|
||||
//Check what user's preference is for automatic location detection
|
||||
boolean gpsPrefEnabled = gpsPreferenceEnabled();
|
||||
|
||||
//Check that currentLatitude and currentLongitude have been
|
||||
// explicitly set by MyLocationListener
|
||||
// and do not default to (0.0,0.0)
|
||||
if (gpsPrefEnabled && currentLatitude != null && currentLongitude != null) {
|
||||
Timber.d("Current location values: Lat = %f Long = %f", currentLatitude, currentLongitude);
|
||||
return String.valueOf(currentLatitude) + "|" + String.valueOf(currentLongitude);
|
||||
} else {
|
||||
// No coords found
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
//If image has EXIF data, extract image coords
|
||||
imageCoordsExists = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue