MaxResultDimension
Limits the larger dimension of the resulting image. It overrides the imgproxy configuration.
imgproxy: max_result_dimension (alias mrd) · Availability: all editions
use SomehowDigital\ImgProxy\Url;use SomehowDigital\ImgProxy\Option\MaxResultDimension;
$url = Url::create() ->source('https://example.com/image.jpg') ->options(new MaxResultDimension(4096));
$url->build();// _/mrd:4096/plain/https%3A%2F%2Fexample.com%2Fimage.jpgThe option appears in the URL as mrd:4096.
Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
$size |
int |
required | Maximum dimension in pixels. 0 disables the limit. |
- Values below 0 throw an
InvalidArgumentException. - imgproxy only honors this option when
IMGPROXY_ALLOW_SECURITY_OPTIONSis enabled.