function __construct($image, $isfile = false, $format = 'jpeg') { if ($isfile) { $this->filename = $image; parent::__construct(NULL, false); } else { parent::__construct($image, false); } }
function __construct($image, $isfile = false) { if ($isfile) { $blob = imagick_readimage($image); parent::__construct($blob, false); } else { parent::__construct($image, false); $this->data = imagick_blob2image($image); } }
function __construct($image, $isfile = false) { if ($isfile) { $blob = new Imagick(); $blob->readImage($image); parent::__construct($blob, false); } else { parent::__construct($image, false); $this->data = new Imagick(); $this->data->readImageBlob($image); } }
function __construct($image, $isfile = false, $format = 'jpeg') { // Which GD Version do we have? $exts = get_loaded_extensions(); if (in_array('gd', $exts) && !empty($image)) { $this->havegd = true; $this->get_gdinfo(); if ($isfile) { $this->filename = $image; parent::__construct(NULL, false); $this->loaded = false; } else { parent::__construct($image, false); $this->format = $format; $this->loaded = false; } } else { $this->havegd = false; $this->gdinfo = array(); } }
function __construct($image, $isfile = false) { parent::__construct($image, false); // Which GD Version do we have? $exts = get_loaded_extensions(); if (in_array('gd', $exts) && $image != '') { $this->havegd = true; $this->get_gdinfo(); if ($isfile) { $this->format = strtolower(substr($image, strrpos($image, '.') + 1)); if ($this->is_supported($this->format)) { if ($this->format == 'jpg') { $this->format = 'jpeg'; } $this->data = call_user_func('imagecreatefrom' . $this->format, $this->data); } } else { $this->data = imagecreatefromstring($this->data); } } else { $this->havegd = false; $this->gdinfo = array(); } }