[wp-trac] [WordPress Trac] #36477: Responsive images (srcset) can include images larger than the full size (was: Responsive images(srcset) feature makes images fatter.)

WordPress Trac noreply at wordpress.org
Sat Oct 8 04:04:54 UTC 2016


#36477: Responsive images (srcset) can include images larger than the full size
----------------------------+-----------------------------
 Reporter:  peterdavehello  |       Owner:  joemcgill
     Type:  defect (bug)    |      Status:  accepted
 Priority:  normal          |   Milestone:  Future Release
Component:  Media           |     Version:  4.4.2
 Severity:  normal          |  Resolution:
 Keywords:  needs-patch     |     Focuses:  performance
----------------------------+-----------------------------
Changes (by mikeschroder):

 * keywords:  has-patch needs-testing => needs-patch
 * milestone:  4.7 => Future Release


Comment:

 I tested [attachment:36477_1.diff] today -- Thanks for the patch!

 Unfortunately, it looks like running `getImageColors` is 8% and 75% of
 image upload times, with only small images (~120x120) being nearer to that
 8%.

 In the tests I ran (on a standard shared server), this added up to an
 additional 27 seconds to resize time for iPhone 7-sized images.

 This means that if we're going to go with a different method of resizing
 for different amounts of colors present, it'll have to have a different
 way to detect the amount of colors.

 I'd be interested in seeing what a solution that includes saving the sizes
 of images on upload/resize would look like. This would make the data
 available to the srcset code, for better choices on which images are good
 to include.

 I'm going to remove the 4.7 milestone, but if this ticket gets a patch
 that is ready for 4.7, am more than happy to take another look. Also
 updating the title to more accurately reflect the nature of the bug.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36477#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list