src/Modules/Imager/GDDriver.php
public function save($image_path, $format = null, $quality = 80)
    {
        if (is_null($format)) {
            $format = $this->getExtension($image_path);
        }

        switch ($format) {
            case 'image/jpeg':
                $background = $this->getJPGBackground();
                imagejpeg($background, $image_path, $quality);
                imagedestroy($background);
                break;
            case 'image/png':
                imagesavealpha($this->image_handler, true);
                imagepng($this->image_handler, $image_path);
                break;
            case 'image/gif':
                imagegif($this->image_handler, $image_path);
                break;
            default:
                throw new \LogicException("Image type '" . $format . "' don`t support");
        }
        return $this;
    }
public function save($image_path, $format = null, $quality = 80)
    {
        if (is_null($format)) {
            $format = $this->getExtension($image_path);
        }

        switch ($format) {
            case 'image/jpeg':
                $background = $this->getJPGBackground();
                imagejpeg($background, $image_path, $quality);
                imagedestroy($background);
                break;
            case 'image/png':
                imagesavealpha($this->image_handler, true);
                imagepng($this->image_handler, $image_path);
                break;
            case 'image/gif':
                imagegif($this->image_handler, $image_path);
                break;
            default:
                throw new \LogicException("Image type '" . $format . "' don`t support");
        }
        return $this;
    }
@param string $image_path
@param string $format
@param integer $quality

@return $this

@throws \LogicException