$file->crop()
Crops the image by the given width and height
Parameters
Name | Type | Default |
---|---|---|
$width * | int |
– |
$height | int |null |
null |
$options | string |array |
null |
Return type
Kirby\Cms\FileVersion
|Kirby\Cms\File
Parent class
Example
Crop positions
You can define from which side or corner a file should be cropped. The following crop options are available:
top left
top
top right
left
center
right
bottom left
bottom
bottom right
This is how to use the crop positions in your code: