diff --git a/lib/PHPExif/Mapper/Native.php b/lib/PHPExif/Mapper/Native.php index e5e826d..40d3c95 100644 --- a/lib/PHPExif/Mapper/Native.php +++ b/lib/PHPExif/Mapper/Native.php @@ -249,11 +249,14 @@ protected function isFieldKnown(&$field) /** * Extract GPS coordinates from components array * - * @param array $components + * @param array|string $components * @return float */ - protected function extractGPSCoordinate(array $components) + protected function extractGPSCoordinate($components) { + if (!is_array($components)) { + $components = array($components); + } $components = array_map(array($this, 'normalizeComponent'), $components); if (count($components) > 2) { diff --git a/tests/PHPExif/ExifTest.php b/tests/PHPExif/ExifTest.php index bc8bd01..82881d2 100755 --- a/tests/PHPExif/ExifTest.php +++ b/tests/PHPExif/ExifTest.php @@ -611,7 +611,8 @@ public function testAdapterConsistency() $methods = $reflClass->getMethods(ReflectionMethod::IS_PUBLIC); $testfiles = array( PHPEXIF_TEST_ROOT . '/files/morning_glory_pool_500.jpg', - PHPEXIF_TEST_ROOT . '/files/dsc_5794.jpg' + PHPEXIF_TEST_ROOT . '/files/dsc_5794.jpg', + PHPEXIF_TEST_ROOT . '/files/dsc_0003.jpg' ); $adapter_exiftool = new \PHPExif\Adapter\Exiftool(); diff --git a/tests/files/dsc_0003.jpg b/tests/files/dsc_0003.jpg new file mode 100644 index 0000000..1f6f8f4 Binary files /dev/null and b/tests/files/dsc_0003.jpg differ