Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/PHPExif/Mapper/ImageMagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ protected function extractGPSCoordinates(string $coordinates): float|false
if (is_numeric($coordinates) === true) {
return ((float) $coordinates);
} else {
$m = '!^([0-9]+\/[1-9][0-9]*)(?:, ([0-9]+\/[1-9][0-9]*))?(?:, ([0-9]+\/[1-9][0-9]*))?$!';
$m = '!^([0-9]+\/[1-9][0-9]*)(?:,\s*([0-9]+\/[1-9][0-9]*))?(?:,\s*([0-9]+\/[1-9][0-9]*))?$!';
if (preg_match($m, $coordinates, $matches) === 0) {
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/PHPExif/ExifTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -741,10 +741,10 @@ public function testAdapterConsistency()
'Adapter difference detected native/exiftool in method "' . $name . '" on image "' . basename($file) . '"'
);

if (in_array(basename($file), ['dsc_0003.jpg', 'mongolia.jpeg'], true)
if (in_array(basename($file), ['dsc_0003.jpg'], true)
&& in_array($name, ['getGPS', 'getLongitude', 'getLatitude'], true)
&& in_array($result_native, ['1,1', 1.0, '46.898392,102.76863098333', 46.898392, 102.768630983333], true)
&& $result_imagemagick === false) {
&& in_array($result_native, ['1,1', 1.0], true)
&& in_array($result_imagemagick, ['1.017917240991,1.075044832787', 1.017917240991, 1.075044832787], true)) {
// Skip that test...
// Something is going wrong here, no clue what.
// Suspect it is on php-imagick side.
Expand Down