Skip to content

Kirby 6.0.0

$asset->crop()

Crops the image by the given width and height

$asset->crop(int $width, int|null $height = null, mixed $options = null): FileVersion|File|Asset

Parameters

Name Type Default
$widthrequired int no default value
$height intornull null
$options mixed null

Return types

Kirby\Cms\FileVersionorKirby\Cms\FileorKirby\Filesystem\Asset

Parent class

Kirby\Filesystem\Asset