92, 'imconvert' => '/usr/bin/convert', ]; /** * This is a factory only, thus the constructor is private */ private function __construct() { // there is no constructor. } /** * Start processing the image * * @param string $imagePath * @param array $options * @return Adapter * @throws Exception */ public static function run($imagePath, $options = []) { $options = array_merge(self::DEFAULT_OPTIONS, $options); if (is_executable($options['imconvert'])) { return new ImageMagickAdapter($imagePath, $options); } if (function_exists('gd_info')) { return new GdAdapter($imagePath, $options); } throw new Exception('No suitable Adapter found'); } }