Make sure when resizing an image according to ratio we do not end up with a zero-pixel width or height.

props plocha.
fixes #25038.

Built from https://develop.svn.wordpress.org/trunk@25744


git-svn-id: http://core.svn.wordpress.org/trunk@25657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin
2013-10-09 19:07:17 +00:00
parent 66be5edfb5
commit f0eb99952c
2 changed files with 5 additions and 4 deletions

View File

@@ -467,8 +467,8 @@ function stream_preview_image( $post_id ) {
$h = $size['height'];
$ratio = _image_get_preview_ratio( $w, $h );
$w2 = $w * $ratio;
$h2 = $h * $ratio;
$w2 = max ( 1, $w * $ratio );
$h2 = max ( 1, $h * $ratio );
if ( is_wp_error( $img->resize( $w2, $h2 ) ) )
return false;