Changeset 27794 for trunk/src/wp-includes/class-wp-image-editor-gd.php
- Timestamp:
- 03/27/2014 08:39:08 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-image-editor-gd.php
r26851 r27794 141 141 * Wraps _resize, since _resize returns a GD Resource. 142 142 * 143 * @since 3.5.0 144 * @access public 145 * 146 * @param int $max_w 147 * @param int $max_h 148 * @param boolean $crop 143 * At minimum, either a height or width must be provided. 144 * If one of the two is set to null, the resize will 145 * maintain aspect ratio according to the provided dimension. 146 * 147 * @since 3.5.0 148 * @access public 149 * 150 * @param int|null $max_w Image width. 151 * @param int|null $max_h Image height. 152 * @param boolean $crop 149 153 * @return boolean|WP_Error 150 154 */ … … 193 197 * An array of image size arrays. Default sizes are 'small', 'medium', 'large'. 194 198 * 199 * Either a height or width must be provided. 200 * If one of the two is set to null, the resize will 201 * maintain aspect ratio according to the provided dimension. 202 * 195 203 * @type array $size { 196 * @type int $widthImage width.197 * @type int $heightImage height.198 * @type bool $cropOptional. Whether to crop the image. Default false.204 * @type int ['width'] Optional. Image width. 205 * @type int ['height'] Optional. Image height. 206 * @type bool ['crop'] Optional. Whether to crop the image. Default false. 199 207 * } 200 208 * } 201 * @return array An array of resized images metadata by size.209 * @return array An array of resized images' metadata by size. 202 210 */ 203 211 public function multi_resize( $sizes ) { … … 206 214 207 215 foreach ( $sizes as $size => $size_data ) { 208 if ( ! ( isset( $size_data['width'] ) && isset( $size_data['height'] ) ) )216 if ( ! isset( $size_data['width'] ) && ! isset( $size_data['height'] ) ) { 209 217 continue; 210 211 if ( ! isset( $size_data['crop'] ) ) 218 } 219 220 if ( ! isset( $size_data['width'] ) ) { 221 $size_data['width'] = null; 222 } 223 if ( ! isset( $size_data['height'] ) ) { 224 $size_data['height'] = null; 225 } 226 227 if ( ! isset( $size_data['crop'] ) ) { 212 228 $size_data['crop'] = false; 229 } 213 230 214 231 $image = $this->_resize( $size_data['width'], $size_data['height'], $size_data['crop'] );
Note: See TracChangeset
for help on using the changeset viewer.