Skip to main content

Width and height

Pass dimensions in pixels to resize(), fit() or crop(). When the height is omitted, these Builder methods use the supplied width for both dimensions. An aspect-preserving fit can still produce a non-square derivative.

$url = sGallery::file($item->src)->fit('max', 500, 300)->getFile();

See Resize for explicit dimensions and Fit for aspect-ratio behavior.