Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d59f90f authored by Abhishek Aggarwal's avatar Abhishek Aggarwal
Browse files

Gallery2: Show proper latitude and longitude

Change-Id: Ie58dc18680ea13373bfdd800c6397b33da5501b9
parent a9983149
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -171,12 +171,9 @@ public class MediaDetails implements Iterable<Entry<Integer, Object>> {
                    focalTag.getValueAsRational(0).toDouble());
            details.setUnit(MediaDetails.INDEX_FOCAL_LENGTH, R.string.unit_mm);
        }
        ExifTag latitudeTag = exif.getTag(ExifInterface.TAG_GPS_LATITUDE);
        ExifTag longitudeTag = exif.getTag(ExifInterface.TAG_GPS_LONGITUDE);
        if (latitudeTag != null && longitudeTag != null) {
            double latitude = latitudeTag.getValueAsRational(0).toDouble();
            double longitude = longitudeTag.getValueAsRational(0).toDouble();
            details.addDetail(MediaDetails.INDEX_LOCATION, new double[] {latitude, longitude});
        double[] latLong = exif.getLatLongAsDoubles();
        if (latLong != null) {
            details.addDetail(MediaDetails.INDEX_LOCATION, latLong);
        }
    }
}