diff --git a/wp-gpx-maps_utils_nggallery.php b/wp-gpx-maps_utils_nggallery.php index c18bd4b..aafe695 100644 --- a/wp-gpx-maps_utils_nggallery.php +++ b/wp-gpx-maps_utils_nggallery.php @@ -39,8 +39,10 @@ function getNGGalleryImages( $ngGalleries, $ngImages, $dt, $lat, $lon, $dtoffset if ( is_callable( 'exif_read_data' ) ) { $exif = @exif_read_data( $p->imagePath ); if ( $exif !== false ) { - $item['lon'] = getExifGps( $exif['GPSLongitude'], $exif['GPSLongitudeRef'] ); - $item['lat'] = getExifGps( $exif['GPSLatitude'], $exif['GPSLatitudeRef'] ); + $item['lon'] = (array_key_exists('GPSLongiture', $exif) and array_key_exists('GPSLongitudeRef', $exif)) ? + getExifGps( $exif['GPSLongitude'], $exif['GPSLongitudeRef'] ) : 0; + $item['lat'] = (array_key_exists('GPSLatitude', $exif) and array_key_exists('GPSLatitudeRef', $exif)) ? + getExifGps( $exif['GPSLatitude'], $exif['GPSLatitudeRef'] ) : 0; if ( ( $item['lat'] != 0 ) || ( $item['lon'] != 0 ) ) { $result[] = $item; } elseif ( isset( $p->imagedate ) ) {