From 6655fa6bc74a69794b06ee9f064bb08ba8c02d9b Mon Sep 17 00:00:00 2001 From: markjaquith Date: Thu, 27 May 2010 04:40:14 +0000 Subject: [PATCH] Use the correct array members of image_resize_dimensions() result when calculating best match for dynamic HTML image resize. fixes #13556 git-svn-id: http://svn.automattic.com/wordpress/trunk@14979 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 23abf1d9f..7a333c476 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -516,7 +516,7 @@ function image_get_intermediate_size($post_id, $size='thumbnail') { // First, we calculate what size the original image would be if constrained to a box the size of the current image in the loop $maybe_cropped = image_resize_dimensions($imagedata['width'], $imagedata['height'], $data['width'], $data['height'], false ); // If the size doesn't match exactly, then it is of a different aspect ratio, so we skip it, unless it's the thumbnail size - if ( 'thumbnail' != $_size && ( !$maybe_cropped || $maybe_cropped[0] != $data['width'] || $maybe_cropped[1] != $data['height'] ) ) + if ( 'thumbnail' != $_size && ( !$maybe_cropped || $maybe_cropped[4] != $data['width'] || $maybe_cropped[5] != $data['height'] ) ) continue; // If we're still here, then we're going to use this size $file = $data['file'];