Skip to content

Commit

Permalink
GPSAltitudeRef below sea level
Browse files Browse the repository at this point in the history
Fix GPSAltitudeRef below sea level.

Signed-off-by: Clint Johnson <[email protected]>
  • Loading branch information
nmbgeek authored Sep 23, 2024
1 parent e8a6d09 commit 44e3070
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Listener/ExifMetadataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function handle(Event $event): void {
}

if (array_key_exists('GPSAltitude', $rawExifData['GPS']) && array_key_exists('GPSAltitudeRef', $rawExifData['GPS']) && is_string($rawExifData['GPS']['GPSAltitude'])) {
$gps['altitude'] = ($rawExifData['GPS']['GPSAltitudeRef'] === '1' ? -1 : 1) * $this->parseGPSData($rawExifData['GPS']['GPSAltitude']);
$gps['altitude'] = ($rawExifData['GPS']['GPSAltitudeRef'] === '1' || $rawExifData['GPS']['GPSAltitudeRef'] === "\u{0001}" ? -1 : 1) * $this->parseGPSData($rawExifData['GPS']['GPSAltitude']);
}

if (!empty($gps)) {
Expand Down

0 comments on commit 44e3070

Please sign in to comment.