Skip to content

Kirby 3.9.8

$dimensions->fitWidthAndHeight()

Recalculates the dimensions by the width and height

$dimensions->fitWidthAndHeight(?int $width = null, ?int $height = null, bool $force = false): Kirby\Image\Dimensions

Parameters

Name Type Default Description
$width int|null null the max height
$height int|null null the max width
$force bool false

Return type

Kirby\Image\Dimensions

This method does not modify the existing $dimensions object but returns a new object with the changes applied. Learn more →

Parent class

Kirby\Image\Dimensions