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
This commit is contained in:
Scott Taylor 2015-12-01 20:57:42 +00:00
parent aad857409b
commit a8523ae92a
1 changed files with 2 additions and 2 deletions

View File

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