/** * 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); }
/** * 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'); } }
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); } }
/** * Destructor. * * @api */ public function __destruct() { parent::__destruct(); }
/** * 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); } }