/** * Checks if ImageMagick is enabled. * * @throws Kohana_Exception * @return boolean */ public static function check() { if (!extension_loaded('imagick')) { throw new Kohana_Exception('Imagick is not installed, or the extension is not loaded'); } return Image_Imagick::$_checked = true; }
/** * Runs [Image_Imagick::check] and loads the image. * * @param string $file */ public function __construct($file) { if (!Image_Imagick::$_checked) { // Run the install check Image_Imagick::check(); } parent::__construct($file); $this->im = new Imagick($file); }
/** * Runs [Image_Imagick::check] and loads the image. * * @return void * @throws Gleez_Exception */ public function __construct($file) { if (!Image_Imagick::$_checked) { // Run the install check Image_Imagick::check(); } parent::__construct($file); $this->im = new Imagick(); $this->im->readImage($file); if (!$this->im->getImageAlphaChannel()) { // Force the image to have an alpha channel $this->im->setImageAlphaChannel(Imagick::ALPHACHANNEL_SET); } }