Resizes current image.
Description
At minimum, either a height or width must be provided.
If one of the two is set to null, the resize will maintain aspect ratio according to the provided dimension.
Parameters
$max_w
int|nullrequired- Image width.
$max_h
int|nullrequired- Image height.
$crop
bool|arrayoptional- Image cropping behavior. If false, the image will be scaled (default).
If true, image will be cropped to the specified dimensions using center positions.
If an array, the image will be cropped using the array to specify the crop location:0
stringThe x crop position. Accepts'left'
'center'
, or'right'
.1
stringThe y crop position. Accepts'top'
,'center'
, or'bottom'
.
Default:
false
Source
abstract public function resize( $max_w, $max_h, $crop = false );
Changelog
Version | Description |
---|---|
3.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.