src/Image/Driver/Gd.php
protected function crop($with, $height, $newWidth, $newHeight)
    {
        $cropStartX = ($with / 2) - ($newWidth / 2);
        $cropStartY = ($height / 2) - ($newHeight / 2);
        $crop = $this->imageResized;
        $this->imageResized = imagecreatetruecolor($newWidth, $newHeight);
        imagecopyresampled(
            $this->imageResized,
            $crop,
            0,
            0,
            $cropStartX,
            $cropStartY,
            $newWidth,
            $newHeight,
            $newWidth,
            $newHeight
        );

        return $this;
    }
protected function crop($with, $height, $newWidth, $newHeight)
    {
        $cropStartX = ($with / 2) - ($newWidth / 2);
        $cropStartY = ($height / 2) - ($newHeight / 2);
        $crop = $this->imageResized;
        $this->imageResized = imagecreatetruecolor($newWidth, $newHeight);
        imagecopyresampled(
            $this->imageResized,
            $crop,
            0,
            0,
            $cropStartX,
            $cropStartY,
            $newWidth,
            $newHeight,
            $newWidth,
            $newHeight
        );

        return $this;
    }
protected function crop ( $ with , $ height , $ newWidth , $ newHeight ) { $ cropStartX = ( $ with / 2 ) - ( $ newWidth / 2 ) ; $ cropStartY = ( $ height / 2 ) - ( $ newHeight / 2 ) ; $ crop = $ this -> imageResized ; $ this -> imageResized = imagecreatetruecolor ( $ newWidth , $ newHeight ) ; imagecopyresampled ( $ this -> imageResized , $ crop , 0 , 0 , $ cropStartX , $ cropStartY , $ newWidth , $ newHeight , $ newWidth , $ newHeight ) ; return $ this ; }
Crop the Image

@param int $with
@param int $height
@param int $newWidth
@param int $newHeight
@return self $this
Crop the Image