Wraps ::_resize() which returns a GD resource or GdImage instance. 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_wint|null
Image width.
$max_hint|null
Image height.
$cropbool|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: @type string $0 The x crop position. Accepts 'left' 'center', or 'right'.Default: false
$1string
The y crop position. Accepts 'top', 'center', or 'bottom'.
Return
true|WP_Error
Uses · 5
is_gd_image()Determines whether the value is an acceptable type for GD image functions.
is_wp_error()Checks whether the given variable is a WordPress Error.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 6.7.7 tag, from src/wp-includes/class-wp-image-editor-gd.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.