PHP function imagecrop()

Availability in versions: PHP 5.5.0

Crop an image using the given coordinates and size, x, y, width and height

Parameters

Parameter Data type Default value Note
$image resource An image resource, returned by one of the image creation functions, such as {@link https://www.php.net/manual/en/function.imagecreatetruecolor.php imagecreatetruecolor()}.
$rect array Array with keys "x", "y", "width" and "height".

Return values

resource

|bool Return cropped image resource on success or FALSE on failure.

Other resources

Newsletter

Nejlepsi tipy a triky o PHP do Vaseho e-mailu. Clanky a novinky nejen ze sveta PHP a programovani.