Handle GD errors correctly during image resizing. Fixes #6087. Hat tip: tellyworth.

git-svn-id: http://svn.automattic.com/wordpress/trunk@7150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2008-03-04 04:23:35 +00:00
parent 0456afb16d
commit 6ecded2a95
1 changed files with 1 additions and 1 deletions

View File

@ -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],