protected function convertResource($convertTo)
    {
        $this->tmpImage[] = $tmpImage = tempnam(sys_get_temp_dir(), 'picture');

        if($this->isGd())
        {
            imagepng($this->resource, $tmpImage, 0);
        }
        else
        {
            $this->resource->writeImage($tmpImage);
        }

        if($convertTo === $this::WORKER_GD)
        {
            return $this->getGdResource($tmpImage);
        }
        else
        {
            return $this->createImagick($tmpImage);
        }
    }
protected function convertResource($convertTo)
    {
        $this->tmpImage[] = $tmpImage = tempnam(sys_get_temp_dir(), 'picture');

        if($this->isGd())
        {
            imagepng($this->resource, $tmpImage, 0);
        }
        else
        {
            $this->resource->writeImage($tmpImage);
        }

        if($convertTo === $this::WORKER_GD)
        {
            return $this->getGdResource($tmpImage);
        }
        else
        {
            return $this->createImagick($tmpImage);
        }
    }
protected function convertResource ( $ convertTo ) { $ this -> tmpImage [ ] = $ tmpImage = tempnam ( sys_get_temp_dir ( ) , 'picture' ) ; if ( $ this -> isGd ( ) ) { imagepng ( $ this -> resource , $ tmpImage , 0 ) ; } else { $ this -> resource -> writeImage ( $ tmpImage ) ; } if ( $ convertTo === $ this :: WORKER_GD ) { return $ this -> getGdResource ( $ tmpImage ) ; } else { return $ this -> createImagick ( $ tmpImage ) ; } }
Performs conversion between GD and Imagick resource instances.
@param string $convertTo worker constant
@return Imagick|resource
@throws Exception
Performs conversion between GD and Imagick resource instances .