Opened 7 years ago
Last modified 5 years ago
#44456 new defect (bug)
srcset max-width set to image width
Reported by: | mikedunn | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.9.6 |
Component: | Media | Keywords: | |
Focuses: | Cc: |
Description
My understanding is the max-width value in the image srcset should be limited to 1600px, however it is actually always set to the width of the original image. Also, max_srcset_image_width does not appear to be properly setting the max-width value either.
Thanks,
Mike
Note: See
TracTickets for help on using
tickets.
Hi and thanks for the ticket!
I'm setting the component to Media for better visibility.
It's worth noting that the
max-width
value can be filtered usingwp_calculate_image_sizes
for content images (orwp_get_attachment_image_attributes
for featured images). See Twenty Sixteen theme for an example.Also, since WordPress 5.3, original images (JPEGs) can be scaled when uploaded. The default maximum dimension is 2560px, and the big_image_size_threshold filter can adjust that value.