Gallery wrongly parses GPS position
- /e/ version: 10 (QQ3A.200805.001)
- Device model(s): FP3
- Device rooted: no
Summary
Gallery fails to correctly parse the GPS information in the EXIF data. The fractional part is discarded, and only full degrees are shown. What should be N49.299… is only reported as N49.0000000. The same goes for the longitude. When the Location is resolved to a placename, "Grand Est, Bas-Rhin, Schleithal, D 244, 67160 France" is reported, so the error is not just in the display, but also passed on to the reverse geocoding.
The problem
Take a picture with GPS location information encoded as degrees, minutes, seconds added to the EXIF metadata.
What is the current behavior?
The latitude is parsed as 49.000000000, longitude as 8.000000000.
What is the expected correct behavior?
The latitude should be parsed as 49.29941, longitude as 8.49027.
Technical informations
The data in the file in question is (as reported by exiftool):
$ exiftool DSCN5016.JPG | grep GPS
GPS Version ID : 2.3.0.0
GPS Latitude Ref : North
GPS Longitude Ref : East
GPS Altitude Ref : Above Sea Level
GPS Time Stamp : 13:29:34
GPS Satellites : 12
GPS Img Direction Ref : True North
GPS Img Direction : undef
GPS Map Datum : WGS84
GPS Processing Method : GPS
GPS Date Stamp : 2021:02:14
GPS Date/Time : 2021:02:14 13:29:34Z
GPS Latitude : 49 deg 17' 57.88" N
GPS Longitude : 8 deg 29' 24.98" E
GPS Position : 49 deg 17' 57.88" N, 8 deg 29' 24.98" E
Also see attached file and screenshot for the actual EXIF data.5016.exif
Possible fixes
From a (very) cursory look at the code, it seems that the special format of (at least this file's) GPS information is not taken into account at https://github.com/LineageOS/android_packages_apps_Gallery2/blob/lineage-18.1/src/com/android/gallery3d/data/MediaDetails.java#L177. One rational is retrieved, when the data are encoded as three rationals for latitude and longitude each.