Пример #1
0
 /**
  * ImagickImage constructor
  */
 public function __construct($sPath)
 {
     if (!extension_loaded('imagick')) {
         throw new Exception('You do not have the ImageMagick PECL extension installed. This class requires this extension to function properly.');
     }
     parent::__construct($sPath);
 }
Пример #2
0
 /**
  * Limitation on the GD library to GIF, PNG & JPEG
  * @see AbstractImage::retrieveType
  */
 protected function retrieveType($sPath)
 {
     parent::retrieveType($sPath);
     if (!in_array($this->type, array(IMAGETYPE_GIF, IMAGETYPE_PNG, IMAGETYPE_JPEG))) {
         throw new Exception('Image type given is not a valid one, only GIF, PNG and JPG are allowed');
     }
 }
Пример #3
0
 public function __construct($wild, $height = 100)
 {
     if (is_int($wild)) {
         parent::__construct($wild, $height);
     } elseif (is_object($wild) && method_exists($wild, 'getImage')) {
         $this->image = $wild->getImage();
     } else {
         $this->fileSource = $wild;
         $this->image = imagecreatefromgif($wild);
     }
 }
Пример #4
0
 /**
  * Destructor.
  *
  * @api
  */
 public function __destruct()
 {
     parent::__destruct();
 }
Пример #5
0
 /**
  * Magic get method to return a manipulation object
  *
  * @param  string $name
  * @return mixed
  */
 public function __get($name)
 {
     switch ($name) {
         case 'adjust':
             return $this->adjust();
         case 'filter':
             return $this->filter();
         case 'layer':
             return $this->layer();
         default:
             return parent::__get($name);
     }
 }