diff options
Diffstat (limited to 'modules/gallery/helpers/graphics.php')
-rw-r--r-- | modules/gallery/helpers/graphics.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index a30699e8..29527705 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -321,16 +321,18 @@ class graphics_Core { // ImageMagick & GraphicsMagick $magick_kits = array( "imagemagick" => array( - "name" => "ImageMagick", "binary" => "convert", "version" => "convert -v"), + "name" => "ImageMagick", "binary" => "convert", "version" => "convert -v", + "version_regex" => "/Version: \S+ (\S+)/"), "graphicsmagick" => array( - "name" => "GraphicsMagick", "binary" => "gm", "version" => "gm version")); + "name" => "GraphicsMagick", "binary" => "gm", "version" => "gm version", + "version_regex" => "/\S+ (\S+)/")); // Loop through the kits foreach ($magick_kits as $index => $settings) { $path = exec("which " . $settings["binary"]); $toolkits->$index->name = $settings["name"]; if ($path) { - if (@is_file($path)) { - preg_match('/Version: \S+ (\S+)/', shell_exec($settings["version"]), $matches); + if (@is_file($path) && + preg_match($settings["version_regex"], shell_exec($settings["version"]), $matches)) { $version = $matches[1]; $toolkits->$index->installed = true; |