[wp-trac] [WordPress Trac] #34196: Add image size between Medium and Large to better take advantage of Responsive Image support

WordPress Trac noreply at wordpress.org
Thu Oct 8 20:16:27 UTC 2015


#34196: Add image size between Medium and Large to better take advantage of
Responsive Image support
-------------------------+--------------------------
 Reporter:  DH-Shredder  |       Owner:  DH-Shredder
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  4.4
Component:  Media        |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:
-------------------------+--------------------------

Comment (by krogsgard):

 Funny enough, I was just doing some testing, and the media modal actually
 acts like the image size is the content width already, for image sizes
 that are in actuality larger. Twenty Sixteen sets content width to 840, so
 you see this:

 [[Image(https://cldup.com/fO5zZgC7OV.png)]]

 When the actual sizes (I changed the content width to account) are this:

 [[Image(https://cldup.com/DHFDDrEnlb.png)]]

 It was super disorienting when testing. The resulting markup is then this:


 {{{
 <a href="http://local.wordpress-trunk.dev/wp-content/uploads/2015/10/cape-
 town1.jpg" rel="attachment wp-att-82"><img src="http://local.wordpress-
 trunk.dev/wp-content/uploads/2015/10/cape-town1-1024x356.jpg" alt="cape-
 town" width="840" height="292" class="alignleft size-large-alt wp-
 image-82" /></a>
 }}}

 And the frontend markup (with srcset) this:


 {{{
 <img src="http://local.wordpress-trunk.dev/wp-content/uploads/2015/10
 /cape-town1-1024x356.jpg" alt="cape-town" width="840" height="292"
 class="alignleft size-large wp-image-82" srcset="http://local.wordpress-
 trunk.dev/wp-content/uploads/2015/10/cape-town1-300x104.jpg 300w,
 http://local.wordpress-trunk.dev/wp-content/uploads/2015/10/cape-
 town1-1024x356.jpg 1024w, http://local.wordpress-trunk.dev/wp-
 content/uploads/2015/10/cape-town1-1200x417.jpg 1200w, http://local
 .wordpress-trunk.dev/wp-content/uploads/2015/10/cape-town1.jpg 1200w"
 sizes="(max-width: 840px) 100vw, 840px">
 }}}

 So the actual image is the large size but the image attributes make it
 seem as if it's smaller.

 I really dislike the defined with and height parameters being set to
 content width. If we have both a content width image and a large image
 (typically larger than content width), I think we'd need to adjust this to
 account for that attachment dropdown in the media insert modal, if not
 also the image markup itself.

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


More information about the wp-trac mailing list