Pop\Image\Gd::createResource PHP Method

createResource() protected method

Create a new image resource based on the current image type of the image object.
protected createResource ( ) : void
return void
    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;
                }
            }
        }
    }