trait DimensionsTrait

Trait DimensionsTrait

Methods

width(int|string|Expression $width)

Sets the width of the asset.

height(int|string|Expression $height)

Sets the height of the asset.

size(string $size)

Sets the width and height of the asset.

aspectRatio(float|array|AspectRatio ...$aspectRatio)

Sets the aspect ratio of the asset.

Details

DimensionsTrait width(int|string|Expression $width)

Sets the width of the asset.

Parameters

Name Type Description
$width int|string|Expression The width in pixels.

Return Value

DimensionsTrait

DimensionsTrait height(int|string|Expression $height)

Sets the height of the asset.

Parameters

Name Type Description
$height int|string|Expression The height in pixels.

Return Value

DimensionsTrait

$this size(string $size)

Sets the width and height of the asset.

Parameters

Name Type Description
$size string The size of asset expressed as "width x height".

Return Value

$this

DimensionsTrait aspectRatio(float|array|AspectRatio ...$aspectRatio)

Sets the aspect ratio of the asset.

Parameters

Name Type Description
...$aspectRatio float|array|AspectRatio The new aspect ratio, specified as a percentage or ratio.

Return Value

DimensionsTrait