dimensions::fitWidth

Recalculates the width and height to fit the given width

dimensions::fitWidth($fit, $force = false)

Parameters

$width (int)
the max width
$force (boolean)
If true, the dimensions will be upscaled to fit the width if smaller

Return values

object
returns this object with recalculated dimensions