Skip to content

Commit 41f23db

Browse files
authored
Merge pull request #73 from maltehuebner/fix-coords
Use floatval() instead of intval() to avoid improper coord values
2 parents 17ca1e7 + ef5269e commit 41f23db

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/PHPExif/Mapper/Exiftool.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ protected function extractGPSCoordinates($coordinates)
204204
return false;
205205
}
206206

207-
return intval($matches[1]) + (intval($matches[2]) / 60) + (floatval($matches[3]) / 3600);
207+
return floatval($matches[1]) + (floatval($matches[2]) / 60) + (floatval($matches[3]) / 3600);
208208
}
209209
}
210210
}

lib/PHPExif/Mapper/Native.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ protected function extractGPSCoordinate($components)
260260
$components = array_map(array($this, 'normalizeComponent'), $components);
261261

262262
if (count($components) > 2) {
263-
return intval($components[0]) + (intval($components[1]) / 60) + (floatval($components[2]) / 3600);
263+
return floatval($components[0]) + (floatval($components[1]) / 60) + (floatval($components[2]) / 3600);
264264
}
265265

266266
return reset($components);

0 commit comments

Comments
 (0)