Handle GD errors correctly during image resizing. Fixes #6087. Hat tip: tellyworth.
git-svn-id: https://develop.svn.wordpress.org/trunk@7150 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
cc3147ab22
commit
22cdc2b75e
|
@ -235,7 +235,7 @@ function image_resize( $file, $max_w, $max_h, $crop=false, $suffix=null, $dest_p
|
|||
function image_make_intermediate_size($file, $width, $height, $crop=false) {
|
||||
if ( $width || $height ) {
|
||||
$resized_file = image_resize($file, $width, $height, $crop);
|
||||
if ( $resized_file && $info = getimagesize($resized_file) ) {
|
||||
if ( !is_wp_error($resized_file) && $resized_file && $info = getimagesize($resized_file) ) {
|
||||
return array(
|
||||
'file' => basename( $resized_file ),
|
||||
'width' => $info[0],
|
||||
|
|
Loading…
Reference in New Issue