1
0
Fork 0

ext-imagick: support version string from ImageMagick 6.x

pull/8123/head
Elan Ruusamäe 2019-03-25 12:12:32 +02:00 committed by Jordi Boggiano
parent 17810b2621
commit 12e683e2ee
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 8 additions and 2 deletions

View File

@ -166,8 +166,14 @@ class PlatformRepository extends ArrayRepository
case 'imagick': case 'imagick':
$imagick = new \Imagick(); $imagick = new \Imagick();
$imageMagickVersion = $imagick->getVersion(); $imageMagickVersion = $imagick->getVersion();
preg_match('/^ImageMagick ([\d.]+)-(\d+)/', $imageMagickVersion['versionString'], $matches); // 6.x: ImageMagick 6.2.9 08/24/06 Q16 http://www.imagemagick.org
// 7.x: ImageMagick 7.0.8-34 Q16 x86_64 2019-03-23 https://imagemagick.org
preg_match('/^ImageMagick ([\d.]+)(?:-(\d+))?/', $imageMagickVersion['versionString'], $matches);
if (isset($matches[2])) {
$prettyVersion = "{$matches[1]}.{$matches[2]}"; $prettyVersion = "{$matches[1]}.{$matches[2]}";
} else {
$prettyVersion = $matches[1];
}
break; break;
case 'libxml': case 'libxml':