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 and artonge committed Sep 24, 2024
1 parent f0a6128 commit d17965c
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 d17965c

Please sign in to comment.