ResizingType
Defines how the image is fitted to the requested size.
imgproxy: resizing_type (alias rt) · Availability: all editions
use SomehowDigital\ImgProxy\Url;use SomehowDigital\ImgProxy\Option\ResizingType;use SomehowDigital\ImgProxy\Option\ResizingTypeEnum;
$url = Url::create() ->source('https://example.com/image.jpg') ->options(new ResizingType(ResizingTypeEnum::FILL));
$url->build();// _/rt:fill/plain/https%3A%2F%2Fexample.com%2Fimage.jpgThe option appears in the URL as rt:fill.
Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
$type |
ResizingTypeEnum |
required | A ResizingTypeEnum case: fit (imgproxy’s default), fill, fill-down, force or auto. Unlike most options, a plain string is not accepted. |
fitresizes the image to fit within the size and keeps the aspect ratio.fillfills the whole size and crops what overflows.fill-downis likefill, but never enlarges the image.forceignores the aspect ratio.autopicksfitorfilldepending on the orientation of source and target.