Pop\Image\Gd::save PHP Method

save() public method

Save the image object to disk.
public save ( string $to = null, boolean $append = false ) : Gd
$to string
$append boolean
return Gd
    public function save($to = null, $append = false)
    {
        if (null === $this->resource) {
            $this->createResource();
        }
        if (null === $this->output) {
            $this->output = $this->resource;
        }
        $this->createImage($this->output, null === $to ? $this->fullpath : $to, $this->quality);
        clearstatcache();
        $this->setFile(null === $to ? $this->fullpath : $to);
        $imgSize = getimagesize($this->fullpath);
        // Set image object properties.
        $this->width = $imgSize[0];
        $this->height = $imgSize[1];
        $this->channels = isset($imgSize['channels']) ? $imgSize['channels'] : null;
        return $this;
    }