Skip to content

Commit d022abe

Browse files
author
Marek Szymczuk
committed
Fixed normalization of zero degrees coordinates in the native mapper
1 parent 4604eb0 commit d022abe

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/PHPExif/Mapper/Native.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,14 @@ protected function normalizeGPSComponent($component)
225225
{
226226
$parts = explode('/', $component);
227227

228-
return count($parts) === 1 ? $parts[0] : (int) reset($parts) / (int) end($parts);
228+
if (count($parts) > 0) {
229+
if ($parts[1]) {
230+
return (int) $parts[0] / (int) $parts[1];
231+
}
232+
233+
return 0;
234+
}
235+
236+
return $parts[0];
229237
}
230238
}

0 commit comments

Comments
 (0)