Core Function
View Source on Trac ↗ image_resize_dimensions()
image_resize_dimensions( mixed $orig_w, mixed $orig_h, mixed $dest_w, mixed $dest_h, mixed $crop = false ) Retrieves calculated resize dimensions for use in WP_Image_Editor.
Parameters 5 required
| Name / Type | Description |
|---|---|
| $orig_w int | Original width in pixels. Required |
| $orig_h int | Original height in pixels. Required |
| $dest_w int | New width in pixels. Required |
| $dest_h int | New height in pixels. Required |
| mixed | (bool | array) $crop { Optional. 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: Required |
Return Value
((array)
| false) Returned array matches parameters for `imagecopyresampled()`. False on failure.
Function Information
Since Version
2.5.0
Source File
wp-includes/media.php
Advertisement