mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
issue #1760 add infos in logger with wrong GPS coordinates
This commit is contained in:
@@ -125,7 +125,7 @@ function clean_iptc_value($value)
|
|||||||
*/
|
*/
|
||||||
function get_exif_data($filename, $map)
|
function get_exif_data($filename, $map)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf, $logger;
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
||||||
@@ -177,11 +177,16 @@ function get_exif_data($filename, $map)
|
|||||||
{
|
{
|
||||||
$latitude = parse_exif_gps_data($gps_exif['GPSLatitude'], $gps_exif['GPSLatitudeRef']);
|
$latitude = parse_exif_gps_data($gps_exif['GPSLatitude'], $gps_exif['GPSLatitudeRef']);
|
||||||
$longitude = parse_exif_gps_data($gps_exif['GPSLongitude'], $gps_exif['GPSLongitudeRef']);
|
$longitude = parse_exif_gps_data($gps_exif['GPSLongitude'], $gps_exif['GPSLongitudeRef']);
|
||||||
|
|
||||||
if ($latitude >= -90.0 && $latitude <= 90.0 && $longitude >= -180.0 && $longitude <= 180.0)
|
if ($latitude >= -90.0 && $latitude <= 90.0 && $longitude >= -180.0 && $longitude <= 180.0)
|
||||||
{
|
{
|
||||||
$result['latitude'] = $latitude;
|
$result['latitude'] = $latitude;
|
||||||
$result['longitude'] = $longitude;
|
$result['longitude'] = $longitude;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$logger->info('['.__FUNCTION__.'][filename='.$filename.'] invalid GPS coordinates, latitude='.$latitude.' longitude='.$longitude);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user