Skip to content
Permalink
Browse files

Docs: Improve and update the description of `multi_resize()` to expla…

…in changes and expected use.

See #40439.

git-svn-id: https://develop.svn.wordpress.org/trunk@45892 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
azaozz committed Aug 25, 2019
1 parent 252e14a commit 152083be8f98ac3379f87c8b0d98c1bed868ace3
Showing with 21 additions and 5 deletions.
  1. +11 −3 src/wp-includes/class-wp-image-editor-gd.php
  2. +10 −2 src/wp-includes/class-wp-image-editor-imagick.php
@@ -197,16 +197,24 @@ protected function _resize( $max_w, $max_h, $crop = false ) {
}
/**
* 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.
@@ -410,12 +410,20 @@ protected function thumbnail_image( $dst_w, $dst_h, $filter_name = 'FILTER_TRIAN
}
/**
* 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

0 comments on commit 152083b

Please sign in to comment.
You can’t perform that action at this time.