On this page
WP_Image_Editor_GD::update_size( int $width = false, int $height = false ): true
Sets or updates current image size.
Parameters
$widthint Optional-
Default:
false $heightint Optional-
Default:
false
Return
true
Source
File: wp-includes/class-wp-image-editor-gd.php. View all references
protected function update_size( $width = false, $height = false ) {
if ( ! $width ) {
$width = imagesx( $this->image );
}
if ( ! $height ) {
$height = imagesy( $this->image );
}
return parent::update_size( $width, $height );
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Image_Editor::update_size() wp-includes/class-wp-image-editor.php | Sets current image size. |
Used By
| Used By | Description |
|---|---|
| WP_Image_Editor_GD::load() wp-includes/class-wp-image-editor-gd.php | Loads image from $this->file into new GD Resource. |
| WP_Image_Editor_GD::_resize() wp-includes/class-wp-image-editor-gd.php | |
| WP_Image_Editor_GD::crop() wp-includes/class-wp-image-editor-gd.php | Crops Image. |
| WP_Image_Editor_GD::rotate() wp-includes/class-wp-image-editor-gd.php | Rotates current image counter-clockwise by $angle. |
Changelog
| Version | Description |
|---|---|
| 3.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_image_editor_gd/update_size