mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 15:09:11 +00:00
Fix: Exif parsers should accept longtitude up to 180 degrees (#1260)
This commit is contained in:
@@ -79,9 +79,9 @@ func extractValidGpsData(fileInfo *exiftool.FileMetadata, mediaPath string) (*fl
|
||||
}
|
||||
|
||||
// GPS data validation
|
||||
if (GPSLat != nil && math.Abs(*GPSLat) > 90) || (GPSLong != nil && math.Abs(*GPSLong) > 90) {
|
||||
if (GPSLat != nil && math.Abs(*GPSLat) > 90) || (GPSLong != nil && math.Abs(*GPSLong) > 180) {
|
||||
log.Printf(
|
||||
"Incorrect GPS data in the %s Exif data: %f, %f, while expected values between '-90' and '90'. Ignoring GPS data.",
|
||||
"Incorrect GPS data in the %s Exif data: %f, %f, while expected latitude between '-90' and '90', and longitude between '-180' and '180'. Ignoring GPS data.",
|
||||
mediaPath, *GPSLat, *GPSLong)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -144,10 +144,10 @@ func (p internalExifParser) ParseExif(mediaPath string) (returnExif *models.Medi
|
||||
|
||||
lat, long, err := exifTags.LatLong()
|
||||
if err == nil {
|
||||
if math.Abs(lat) > 90 || math.Abs(long) > 90 {
|
||||
if math.Abs(lat) > 90 || math.Abs(long) > 180 {
|
||||
returnExif = &newExif
|
||||
log.Printf(
|
||||
"Incorrect GPS data in the %s Exif data: %f, %f, while expected values between '-90' and '90'. Ignoring GPS data.",
|
||||
"Incorrect GPS data in the %s Exif data: %f, %f, while expected latitude between '-90' and '90', and longitude between '-180' and '180'. Ignoring GPS data.",
|
||||
mediaPath, long, lat)
|
||||
return
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user