From a8523ae92aefb0c5295dd30db7d0ad2292b8f403 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 1 Dec 2015 20:57:42 +0000 Subject: [PATCH] Responsive Images: Currently images are included in the `srcset` if the aspect ratio difference is smaller than `0.01`. This number is too high, set it to `0.002` Props joemcgill. Fixes #34810. git-svn-id: https://develop.svn.wordpress.org/trunk@35755 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/media.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index 06c27cbc7f..ddd7088a1d 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -1061,8 +1061,8 @@ function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attac $image_ratio_compare = 0; } - // If the new ratio differs by less than 0.01, use it. - if ( abs( $image_ratio - $image_ratio_compare ) < 0.01 ) { + // If the new ratio differs by less than 0.002, use it. + if ( abs( $image_ratio - $image_ratio_compare ) < 0.002 ) { // Add the URL, descriptor, and value to the sources array to be returned. $sources[ $image['width'] ] = array( 'url' => $image_baseurl . $image['file'],