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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-12-01 20:58:24 +00:00
parent c0f8bd0de2
commit 9b5ffe8062
2 changed files with 3 additions and 3 deletions

View File

@ -1061,8 +1061,8 @@ function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attac
$image_ratio_compare = 0; $image_ratio_compare = 0;
} }
// If the new ratio differs by less than 0.01, use it. // If the new ratio differs by less than 0.002, use it.
if ( abs( $image_ratio - $image_ratio_compare ) < 0.01 ) { if ( abs( $image_ratio - $image_ratio_compare ) < 0.002 ) {
// Add the URL, descriptor, and value to the sources array to be returned. // Add the URL, descriptor, and value to the sources array to be returned.
$sources[ $image['width'] ] = array( $sources[ $image['width'] ] = array(
'url' => $image_baseurl . $image['file'], 'url' => $image_baseurl . $image['file'],

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-RC1-35754'; $wp_version = '4.4-RC1-35755';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.