From c5fed47367654a48c8a4c8f5f9e415580d73d3eb Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sun, 25 Aug 2019 22:21:58 +0000 Subject: [PATCH] Docs: Improve and update the description of `multi_resize()` to explain changes and expected use. See #40439. Built from https://develop.svn.wordpress.org/trunk@45892 git-svn-id: http://core.svn.wordpress.org/trunk@45703 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-image-editor-gd.php | 14 +++++++++++--- wp-includes/class-wp-image-editor-imagick.php | 12 ++++++++++-- wp-includes/version.php | 2 +- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/wp-includes/class-wp-image-editor-gd.php b/wp-includes/class-wp-image-editor-gd.php index daec6b3d04..53cf2ef9be 100644 --- a/wp-includes/class-wp-image-editor-gd.php +++ b/wp-includes/class-wp-image-editor-gd.php @@ -197,16 +197,24 @@ class WP_Image_Editor_GD extends WP_Image_Editor { } /** - * Resize multiple images from a single source. + * Create multiple smaller images from a single source. + * + * Attempts to create all sub-sizes and returns the meta data at the end. This + * may result in the server running out of resources. When it fails there may be few + * "orphaned" images left over as the meta data is never returned and saved. + * + * As of 5.3.0 the preferred way to do this is with `make_subsize()`. It creates + * the new images one at a time and allows for the meta data to be saved after + * each new image is created. * * @since 3.5.0 * * @param array $sizes { - * An array of image size arrays. Default sizes are 'small', 'medium', 'medium_large', 'large'. + * An array of image size data arrays. * * 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. + * maintain aspect ratio according to the source image. * * @type array $size { * Array of height, width values, and whether to crop. diff --git a/wp-includes/class-wp-image-editor-imagick.php b/wp-includes/class-wp-image-editor-imagick.php index 1228ca0575..ba363f23aa 100644 --- a/wp-includes/class-wp-image-editor-imagick.php +++ b/wp-includes/class-wp-image-editor-imagick.php @@ -410,12 +410,20 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { } /** - * Resize multiple images from a single source. + * Create multiple smaller images from a single source. + * + * Attempts to create all sub-sizes and returns the meta data at the end. This + * may result in the server running out of resources. When it fails there may be few + * "orphaned" images left over as the meta data is never returned and saved. + * + * As of 5.3.0 the preferred way to do this is with `make_subsize()`. It creates + * the new images one at a time and allows for the meta data to be saved after + * each new image is created. * * @since 3.5.0 * * @param array $sizes { - * An array of image size arrays. Default sizes are 'thumbnail', 'medium', 'medium_large', 'large'. + * An array of image size data arrays. * * Either a height or width must be provided. * If one of the two is set to null, the resize will diff --git a/wp-includes/version.php b/wp-includes/version.php index ac67f4835a..5590cd0d5c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-45891'; +$wp_version = '5.3-alpha-45892'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.