Width
Sets the width of the resulting image.
imgproxy: width (alias w) · Availability: all editions
use SomehowDigital\ImgProxy\Url;use SomehowDigital\ImgProxy\Option\Width;
$url = Url::create() ->source('https://example.com/image.jpg') ->options(new Width(300));
$url->build();// _/w:300/plain/https%3A%2F%2Fexample.com%2Fimage.jpgThe option appears in the URL as w:300.
Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
$width |
int |
required | Width in pixels. 0 derives the width from the height and the aspect ratio. |
- With the
forceresizing type,0keeps the original width.