true, // processor_path is determined and set by path lookup methods 'GFX/processor_path' => '', 'GFX/processor' => 'ImageMagick', 'GFX/processor_effects' => true, ]; /** * Find executable in path, wrapper for specific ImageMagick/GraphicsMagick find methods. * * @return mixed */ protected function findExecutableInPath(array $searchPaths) { return $this->findImageMagick6InPaths($searchPaths); } /** * Search for GraphicsMagick executables in given paths. * * @param array $searchPaths List of paths to search for * @return bool TRUE if graphics magick was found in path */ protected function findImageMagick6InPaths(array $searchPaths) { $result = false; foreach ($searchPaths as $path) { if (Environment::isWindows()) { $executable = 'identify.exe'; if (!@is_file($path . $executable)) { $executable = 'magick.exe'; } } else { $executable = 'identify'; } $binaryPath = $path . $executable; if (!file_exists($binaryPath) || !is_executable($binaryPath)) { continue; } $command = escapeshellarg($binaryPath) . ' -version'; $executingResult = []; CommandUtility::exec($command, $executingResult); // First line of exec command should contain string GraphicsMagick $firstResultLine = array_shift($executingResult); // Example: "Version: ImageMagick 6.6.0-4 2012-05-02 Q16 http://www.imagemagick.org" if (is_string($firstResultLine) && str_contains($firstResultLine, 'ImageMagick')) { [, $version] = explode('ImageMagick', $firstResultLine); // Example: "6.6.0-4" [$version] = explode(' ', trim($version)); if (version_compare($version, '6.0.0') >= 0) { $this->foundPath = $path; $result = true; break; } } } return $result; } }