예제 #1
0
 /**
  * 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;
 }
예제 #2
0
 /**
  * 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);
 }
예제 #3
0
파일: imagick.php 프로젝트: MenZil-Team/cms
 /**
  * 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);
     }
 }