Opened 8 years ago
Last modified 7 years ago
#44456 new defect (bug)
srcset max-width set to image width
| Reported by: | mikedunn | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Media | Version: | 4.9.6 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Hi and thanks for the ticket!
I'm setting the component to Media for better visibility.
It's worth noting that the
max-widthvalue can be filtered usingwp_calculate_image_sizesfor content images (orwp_get_attachment_image_attributesfor 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.