Ticket #12268: consistent_image_resize_failure.12268.diff
| File consistent_image_resize_failure.12268.diff, 1.1 KB (added by , 16 years ago) |
|---|
-
wp-includes/media.php
348 348 * @param string $suffix Optional. File Suffix. 349 349 * @param string $dest_path Optional. New image file path. 350 350 * @param int $jpeg_quality Optional, default is 90. Image quality percentage. 351 * @return mixed WP_Error on failure. String with new destination path. Array of dimensions from {@link image_resize_dimensions()}351 * @return mixed WP_Error on failure. String with new destination path. 352 352 */ 353 353 function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 90 ) { 354 354 … … 363 363 364 364 $dims = image_resize_dimensions($orig_w, $orig_h, $max_w, $max_h, $crop); 365 365 if ( !$dims ) 366 return $dims;366 return new WP_Error( 'error_getting_dimensions', __('Could not calculate resized image dimensions') ); 367 367 list($dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) = $dims; 368 368 369 369 $newimage = wp_imagecreatetruecolor( $dst_w, $dst_h );