TransformationResizeTrait
trait TransformationResizeTrait
Trait TransformationResizeTrait
Here we add the most common 'aliases' for building transformation at the top level
Methods
Change the size of the image exactly to the given width and height without necessarily retaining the original aspect ratio: all original image parts are visible but might be stretched or shrunk.
Custom resize builder.
Details
TransformationResizeTrait
resize(BaseResizeAction $resize)
Resize the asset using provided resize action
TransformationResizeTrait
scale(int|float|string|null $width = null, int|float|null $height = null, int|float|array $aspectRatio = null)
Change the size of the image exactly to the given width and height without necessarily retaining the original aspect ratio: all original image parts are visible but might be stretched or shrunk.
TransformationResizeTrait
crop(int|float|string|null $width = null, int|float|null $height = null, Gravity $gravity = null, int|float|X $x = null, int|float|Y $y = null)
Extracts a region of the given width and height out of the original image.
TransformationResizeTrait
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.
TransformationResizeTrait
genericResize(string $name, int|float|string|null $width = null, int|float|null $height = null)
Custom resize builder.