$asset->resize()
Resizes the file with the given width and height while keeping the aspect ratio.
$asset->resize(int|null $width = null, int|null $height = null, int|null $quality = null): Kirby\Cms\FileVersion|Kirby\Cms\File|Kirby\Filesystem\Asset
Parameters
| Name | Type | Default |
|---|---|---|
| $width | intornull |
null
|
| $height | intornull |
null
|
| $quality | intornull |
null
|
Return types
Kirby\Cms\FileVersionorKirby\Cms\FileorKirby\Filesystem\Asset
This method modifies the existing $asset object it is applied to and returns it again.
Exceptions
| Type | Description |
|---|---|
Kirby\Exception\InvalidArgumentException |