Fix: Add check for valid location to handle NAN values (#1054)
This commit is contained in:
commit
adc7389b00
2 changed files with 7 additions and 3 deletions
|
@ -193,8 +193,7 @@ class File extends EnteFile {
|
|||
if (Platform.isAndroid) {
|
||||
//Fix for missing location data in lower android versions.
|
||||
final Location? exifLocation = locationFromExif(exifData);
|
||||
if (exifLocation?.latitude != null &&
|
||||
exifLocation?.longitude != null) {
|
||||
if (Location.isValidLocation(exifLocation)) {
|
||||
location = exifLocation;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -243,9 +243,14 @@ class GPSData {
|
|||
return null;
|
||||
}
|
||||
|
||||
return Location(
|
||||
final result = Location(
|
||||
latitude: latSign * (lat![0] + lat![1] / 60 + lat![2] / 3600),
|
||||
longitude: longSign * (long![0] + long![1] / 60 + long![2] / 3600),
|
||||
);
|
||||
if (Location.isValidLocation(result)) {
|
||||
return result;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue