Gc\Media\Image::crop PHP Метод

crop() защищенный Метод

Crop image
protected crop ( integer $newWidth, integer $newHeight, integer $sourceX, integer $sourceY ) : Image
$newWidth integer New width
$newHeight integer New height
$sourceX integer Source x
$sourceY integer Source y
Результат Image
    protected function crop($newWidth, $newHeight, $sourceX = 0, $sourceY = 0)
    {
        $this->imageResized = imagecreatetruecolor($newWidth, $newHeight);
        imagecopyresampled($this->imageResized, $this->image, 0, 0, $sourceX, $sourceY, $this->width, $this->height, $this->width, $this->height);
        return $this;
    }