Think/Image/Driver/Imagick.php
private function _crop($w, $h, $x, $y, $width, $height, $img = null)
    {
        is_null($img) && $img = $this->img;

        //裁剪
        $_info = $this->info;
        if ($x != 0 || $y != 0 || $w != $_info['width'] || $h != $_info['height']) {
            $img->cropImage($w, $h, $x, $y);
            $img->setImagePage($w, $h, 0, 0); //调整画布和图片一致
        }

        //调整大小
        if ($w != $width || $h != $height) {
            $img->sampleImage($width, $height);
        }

        //设置缓存尺寸
        $this->info['width'] = $width;
        $this->info['height'] = $height;
    }
private function _crop($w, $h, $x, $y, $width, $height, $img = null)
    {
        is_null($img) && $img = $this->img;

        //裁剪
        $_info = $this->info;
        if ($x != 0 || $y != 0 || $w != $_info['width'] || $h != $_info['height']) {
            $img->cropImage($w, $h, $x, $y);
            $img->setImagePage($w, $h, 0, 0); //调整画布和图片一致
        }

        //调整大小
        if ($w != $width || $h != $height) {
            $img->sampleImage($width, $height);
        }

        //设置缓存尺寸
        $this->info['width'] = $width;
        $this->info['height'] = $height;
    }
裁剪图片，内部调用

@param      $w
@param      $h
@param      $x
@param      $y
@param      $width
@param      $height
@param null $img