trait FillPadTrait

Trait FillPadTrait

Methods

fillPad(int|float|string|null $width = null, int|float|null $height = null, FocalGravity|string $gravity = null, string|ColorValue $background = null)

Tries to prevent a "bad crop" by first attempting to use the fill mode, but adding padding if it is determined that more of the original image needs to be included in the final image.

Details

static FillPad fillPad(int|float|string|null $width = null, int|float|null $height = null, FocalGravity|string $gravity = null, string|ColorValue $background = null)

Tries to prevent a "bad crop" by first attempting to use the fill mode, but adding padding if it is determined that more of the original image needs to be included in the final image.

Especially useful if the aspect ratio of the delivered image is considerably different from the original's aspect ratio.

Only supported in conjunction with Automatic cropping (Gravity::auto())

Parameters

Name Type Description
$width int|float|string|null The required width of a transformed asset.
$height int|float|null The required height of a transformed asset.
$gravity FocalGravity|string Specifies which part of the original image to include.
$background string|ColorValue The background color of the image.

Return Value

FillPad

See also

Gravity::auto