src/thinkextend/image/driver/Imagick.php
public function save($imgname, $type = null, $interlace = true)
    {
        if (empty($this->im)) {
            throw new \Exception('没有可以被保存的图像资源');
        }

        //设置图片类型
        if (is_null($type)) {
            $type = $this->info['type'];
        } else {
            $type = strtolower($type);
            $this->im->setImageFormat($type);
        }

        //JPEG图像设置隔行扫描
        if ('jpeg' == $type || 'jpg' == $type) {
            $this->im->setImageInterlaceScheme(1);
        }

        //去除图像配置信息
        $this->im->stripImage();

        //保存图像
        $imgname = realpath(dirname($imgname)) . '/' . basename($imgname); //强制绝对路径
        if ('gif' == $type) {
            $this->im->writeImages($imgname, true);
        } else {
            $this->im->writeImage($imgname);
        }
    }
public function save($imgname, $type = null, $interlace = true)
    {
        if (empty($this->im)) {
            throw new \Exception('没有可以被保存的图像资源');
        }

        //设置图片类型
        if (is_null($type)) {
            $type = $this->info['type'];
        } else {
            $type = strtolower($type);
            $this->im->setImageFormat($type);
        }

        //JPEG图像设置隔行扫描
        if ('jpeg' == $type || 'jpg' == $type) {
            $this->im->setImageInterlaceScheme(1);
        }

        //去除图像配置信息
        $this->im->stripImage();

        //保存图像
        $imgname = realpath(dirname($imgname)) . '/' . basename($imgname); //强制绝对路径
        if ('gif' == $type) {
            $this->im->writeImages($imgname, true);
        } else {
            $this->im->writeImage($imgname);
        }
    }
保存图像

@param  string  $imgname   图像保存名称
@param  string  $type      图像类型
@param  boolean $interlace 是否对JPEG类型图像设置隔行扫描