Changeset 27794 for trunk/src/wp-includes/class-wp-image-editor-imagick.php
- Timestamp:
- 03/27/2014 08:39:08 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-image-editor-imagick.php
r26851 r27794 212 212 * Resizes current image. 213 213 * 214 * @since 3.5.0 215 * @access public 216 * 217 * @param int $max_w 218 * @param int $max_h 219 * @param boolean $crop 214 * At minimum, either a height or width must be provided. 215 * If one of the two is set to null, the resize will 216 * maintain aspect ratio according to the provided dimension. 217 * 218 * @since 3.5.0 219 * @access public 220 * 221 * @param int|null $max_w Image width. 222 * @param int|null $max_h Image height. 223 * @param boolean $crop 220 224 * @return boolean|WP_Error 221 225 */ … … 256 260 * An array of image size arrays. Default sizes are 'small', 'medium', 'large'. 257 261 * 262 * Either a height or width must be provided. 263 * If one of the two is set to null, the resize will 264 * maintain aspect ratio according to the provided dimension. 265 * 258 266 * @type array $size { 259 * @type int $widthImage width.260 * @type int $heightImage height.267 * @type int ['width'] Optional. Image width. 268 * @type int ['height'] Optional. Image height. 261 269 * @type bool $crop Optional. Whether to crop the image. Default false. 262 270 * } 263 271 * } 264 * @return array An array of resized images metadata by size.272 * @return array An array of resized images' metadata by size. 265 273 */ 266 274 public function multi_resize( $sizes ) { … … 273 281 $this->image = $orig_image->getImage(); 274 282 275 if ( ! ( isset( $size_data['width'] ) && isset( $size_data['height'] ) ) )283 if ( ! isset( $size_data['width'] ) && ! isset( $size_data['height'] ) ) { 276 284 continue; 277 278 if ( ! isset( $size_data['crop'] ) ) 285 } 286 287 if ( ! isset( $size_data['width'] ) ) { 288 $size_data['width'] = null; 289 } 290 if ( ! isset( $size_data['height'] ) ) { 291 $size_data['height'] = null; 292 } 293 294 if ( ! isset( $size_data['crop'] ) ) { 279 295 $size_data['crop'] = false; 296 } 280 297 281 298 $resize_result = $this->resize( $size_data['width'], $size_data['height'], $size_data['crop'] );
Note: See TracChangeset
for help on using the changeset viewer.