src/thinkextend/image/driver/Gd.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);
        }

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

        //保存图像
        if ('gif' == $type && !empty($this->gif)) {
            $this->gif->save($imgname);
        } else {
            $fun = "image{$type}";
            $fun($this->im, $imgname);
        }
        return $this;
    }
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);
        }

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

        //保存图像
        if ('gif' == $type && !empty($this->gif)) {
            $this->gif->save($imgname);
        } else {
            $fun = "image{$type}";
            $fun($this->im, $imgname);
        }
        return $this;
    }
保存图像

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

@return $this
@throws Exception