[wp-trac] [WordPress Trac] #35094: Replace static with Dynamic Image Sizes for inserted images

WordPress Trac noreply at wordpress.org
Sun Mar 27 08:10:49 UTC 2016


#35094: Replace static with Dynamic Image Sizes for inserted images
-------------------------+------------------------------
 Reporter:  mor10        |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Media        |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  administration
-------------------------+------------------------------

Comment (by mor10):

 Replying to [comment:4 jaspermdegroot]:
 > Replying to @mor10:
 >
 > I think that for images inside the content that the user should keep
 control over the image size, not the theme author. So the image size
 should remain the size that has been set in the media settings menu.
 >

 What I am proposing is for the theme author to be able to define the
 default image sizes that fit best with the theme design. Most WordPress
 users never change the default settings in media, and these are arbitrary
 in relation to a theme design. If/when a site admin or author sets a
 custom image size, that image size will have precedence.

 > I don't agree that `width` and `height` attributes don't serve a
 practical purpose anymore now that we landed responsive images in core.
 They tell the browser the dimensions of the `img` element while the
 `srcset` and `sizes` attributes are about what to load into that element.
 `sizes` only provides the browser information to help selecting the best
 source. It doesn't tell the browser at what size to render the image
 element.
 >

 I am saying the width and height attributes are not relevant in the final
 HTML output. The displayed size is controlled by RICG and CSS. This is a
 sidebar matter anyway. I'm not invested in removing the attributes since
 they are not really relevant to disllay. It would just be cleaner.

 > Actually the responsive image functions that we added depend on the
 `width` and `height` attributes. If we would leave it up to theme authors
 to set image dimensions in their stylesheet we wouldn't know what to set
 for the `sizes` attribute.
 >

 What I'm proposing is to tie the sizes attribute to the CSS values. This
 would solve the problem you are outlining.

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


More information about the wp-trac mailing list