Skip to content

Height

Sets the height of the resulting image.

imgproxy: height (alias h) · Availability: all editions

use SomehowDigital\ImgProxy\Url;
use SomehowDigital\ImgProxy\Option\Height;
$url = Url::create()
->source('https://example.com/image.jpg')
->options(new Height(200));
$url->build();
// _/h:200/plain/https%3A%2F%2Fexample.com%2Fimage.jpg

The option appears in the URL as h:200.

Parameter Type Default Description
$height int required Height in pixels. 0 derives the height from the width and the aspect ratio.
  • With the force resizing type, 0 keeps the original height.

imgproxy reference