protected function createResource()
{
if (null !== $this->output) {
$this->resource = is_string($this->output) ? imagecreatefromstring($this->output) : $this->output;
} else {
if (file_exists($this->fullpath)) {
switch ($this->mime) {
case 'image/gif':
$this->resource = imagecreatefromgif($this->fullpath);
break;
case 'image/png':
$this->resource = imagecreatefrompng($this->fullpath);
break;
case 'image/jpeg':
$this->resource = imagecreatefromjpeg($this->fullpath);
break;
}
}
}
}