From 152083be8f98ac3379f87c8b0d98c1bed868ace3 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sun, 25 Aug 2019 22:20:57 +0000 Subject: [PATCH] Docs: Improve and update the description of `multi_resize()` to explain changes and expected use. See #40439. git-svn-id: https://develop.svn.wordpress.org/trunk@45892 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-image-editor-gd.php | 14 +++++++++++--- src/wp-includes/class-wp-image-editor-imagick.php | 12 ++++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/class-wp-image-editor-gd.php b/src/wp-includes/class-wp-image-editor-gd.php index daec6b3d04..53cf2ef9be 100644 --- a/src/wp-includes/class-wp-image-editor-gd.php +++ b/src/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/src/wp-includes/class-wp-image-editor-imagick.php b/src/wp-includes/class-wp-image-editor-imagick.php index 1228ca0575..ba363f23aa 100644 --- a/src/wp-includes/class-wp-image-editor-imagick.php +++ b/src/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