FillTrait
trait FillTrait
Trait FillTrait
Methods
Same as the Fill::fill mode, but only if the original image is larger than the specified resolution limits, in which case the image is scaled down to fill the given width and height without distorting the image, and then the dimension that exceeds the request is cropped.
Details
static Fill
fill(int|float|string|null $width = null, int|float|null $height = null, Gravity $gravity = null)
Creates an image with the exact given width and height without distorting the image.
This option first scales up or down as much as needed to at least fill both of the given dimensions. If the requested aspect ratio is different than the original, cropping will occur on the dimension that exceeds the requested size after scaling.
static Fill
limitFill(int|float|string|null $width = null, int|float|null $height = null, Gravity $gravity = null)
Same as the Fill::fill mode, but only if the original image is larger than the specified resolution limits, in which case the image is scaled down to fill the given width and height without distorting the image, and then the dimension that exceeds the request is cropped.
If the original dimensions are smaller than the requested size, it is not resized at all.
This prevents upscaling.