mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-25 19:00:03 +03:00
issue #1760 add infos in logger with wrong GPS coordinates
This commit is contained in:
parent
235c3644da
commit
138f23d32f
1 changed files with 6 additions and 1 deletions
|
@ -125,7 +125,7 @@ function clean_iptc_value($value)
|
|||
*/
|
||||
function get_exif_data($filename, $map)
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $logger;
|
||||
|
||||
$result = array();
|
||||
|
||||
|
@ -177,11 +177,16 @@ function get_exif_data($filename, $map)
|
|||
{
|
||||
$latitude = parse_exif_gps_data($gps_exif['GPSLatitude'], $gps_exif['GPSLatitudeRef']);
|
||||
$longitude = parse_exif_gps_data($gps_exif['GPSLongitude'], $gps_exif['GPSLongitudeRef']);
|
||||
|
||||
if ($latitude >= -90.0 && $latitude <= 90.0 && $longitude >= -180.0 && $longitude <= 180.0)
|
||||
{
|
||||
$result['latitude'] = $latitude;
|
||||
$result['longitude'] = $longitude;
|
||||
}
|
||||
else
|
||||
{
|
||||
$logger->info('['.__FUNCTION__.'][filename='.$filename.'] invalid GPS coordinates, latitude='.$latitude.' longitude='.$longitude);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue