[wp-trac] [WordPress Trac] #35128: Srcset may include a much-too-large image, apparently no way to set size in context
WordPress Trac
noreply at wordpress.org
Fri Dec 18 04:55:58 UTC 2015
#35128: Srcset may include a much-too-large image, apparently no way to set size in
context
--------------------------+------------------------------
Reporter: programmin | Owner: joemcgill
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 4.4
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by programmin):
There are a few issues here -
When you insert a huge image at full-size, you get the native height= and
width= attributes on image tag. Even if the space it will fill has max-
width and styling that makes a much smaller width.
I see there's a the_content filter call to
wp_make_content_images_responsive() that calls
wp_image_add_srcset_and_sizes() which looks at height and width of img
tag.
If I have an image within a div that ends up 1/3 or 1/4th of the post
display, do I really have to make some goofy regex to search for the <div
class="mythirdsection"> ... images... </div> in the post-content and
change the heights, widths before the_content (default 10 priority) runs?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35128#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list