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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user