public function setResource($resource)
    {
        if($this->getWorker($resource) === $this->getWorker($this->resource))
        {
            $this->resource = $resource;
        }

        $this->tmpImage[] = $tmpImage = tempnam(sys_get_temp_dir(), 'picture');

        if($this->getWorker($resource) === $this::WORKER_GD)
        {
            imagepng($resource, $tmpImage, 0);
        }
        else
        {
            $resource->writeImage($tmpImage);
        }

        if($this->isGd())
        {
            $this->resource = $this->getGdResource($tmpImage);
        }
        else
        {
            $this->resource = $this->createImagick($tmpImage);
        }
    }
public function setResource($resource)
    {
        if($this->getWorker($resource) === $this->getWorker($this->resource))
        {
            $this->resource = $resource;
        }

        $this->tmpImage[] = $tmpImage = tempnam(sys_get_temp_dir(), 'picture');

        if($this->getWorker($resource) === $this::WORKER_GD)
        {
            imagepng($resource, $tmpImage, 0);
        }
        else
        {
            $resource->writeImage($tmpImage);
        }

        if($this->isGd())
        {
            $this->resource = $this->getGdResource($tmpImage);
        }
        else
        {
            $this->resource = $this->createImagick($tmpImage);
        }
    }
public function setResource ( $ resource ) { if ( $ this -> getWorker ( $ resource ) === $ this -> getWorker ( $ this -> resource ) ) { $ this -> resource = $ resource ; } $ this -> tmpImage [ ] = $ tmpImage = tempnam ( sys_get_temp_dir ( ) , 'picture' ) ; if ( $ this -> getWorker ( $ resource ) === $ this :: WORKER_GD ) { imagepng ( $ resource , $ tmpImage , 0 ) ; } else { $ resource -> writeImage ( $ tmpImage ) ; } if ( $ this -> isGd ( ) ) { $ this -> resource = $ this -> getGdResource ( $ tmpImage ) ; } else { $ this -> resource = $ this -> createImagick ( $ tmpImage ) ; } }
Sets the resource picture to another
@param Imagick|resource $resource
Sets the resource picture to another