[wp-trac] [WordPress Trac] #52495: Hard cropped images do not crop specified dimension, causing lack of adaptive images

WordPress Trac noreply at wordpress.org
Thu Feb 11 05:30:26 UTC 2021


#52495: Hard cropped images do not crop specified dimension, causing lack of
adaptive images
--------------------------+-----------------------------
 Reporter:  larssg        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.6.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 If an image is less than the size of a specified image size, it will be
 cropped only on the dimension that is greater than the specified
 dimension. The result is an image that is not the same aspect ratio as
 other images with specified image sizes that have the same aspect ratio.
 So it won't output those other images in an srcset and your site may be
 loading much larger images than needed for mobile.

 For example, I might have defined image sizes of 1000x500, 750x375 and
 500x250 and use those images in my theme. Normally, I'd insert that
 largest image and then the other two would be in an srcset. But, if I were
 to upload and 960x600 image, I'll get a 960x500 image, as well as the
 normal 750x375 and 500x250. Because these aren't the same aspect ratio,
 when I insert the larger image, there is no srcset. Now visitors are stuck
 loading the largest image.

 It would make sense to me for hard crop to scale the image up to meet the
 minimum size for both dimensions, then crop.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52495>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list