WordPress.org

Make WordPress Core

Opened 3 weeks ago

Last modified 8 days ago

#44441 new defect (bug)

Remove the settings for "medium" and "large" image sizes from Settings => Media

Reported by: azaozz Owned by:
Milestone: 5.0 Priority: normal
Severity: normal Version:
Component: Media Keywords:
Focuses: Cc:

Description (last modified by azaozz)

We've been using srcset and sizes img tag attributes for quite a while now. When we added them, they were somewhat "new", but now they are "mainstream" :) (In the browsers this works by disregarding the src attribute and instead using only the srcset attribute.)

This generally means that when creating a post the user is no longer constrained in having to choose a specific image size (that has to exist). The users can add pretty much any size images, only constrained by the theme's content_width, and the browser will choose the proper image file to download for the specific browser/device for each visitor to the site.

In that terms the ability to change the medium and large sizes "by hand" is no longer needed. They are used to support the srcset but they should not be used as restrain when creating a post and inserting an image. Having the max width and max height settings for them on the Settings => Media screen doesn't make sense.

Change History (16)

#1 follow-up: @joyously
3 weeks ago

Since they have been there awhile now, they are used for many other things. So removing them now would impact more than just the narrow scope you have mentioned. I just submitted a theme that uses the existing images sizes in a list for the user to choose which one he wants for a theme option. I'm sure I'm not the only one. There are probably a lot of themes and plugins that use these image sizes.

#2 in reply to: ↑ 1 @azaozz
3 weeks ago

Replying to joyously:

Since they have been there awhile now, they are used for many other things. So removing them now...

Uh, sorry, seems I didn't explain it well and you misunderstood :)

I'm not proposing to remove the image sizes. They are needed to be able to create proper srcset. In fact I think we would need to add another, larger size.

What I'm proposing is to remove the settings for the medium and large sizes from the "Settings => Media" screen as changing them "by hand" doesn't make sense any more. In fact there is already another default size: medium_large, 768px width, that is not shown there :)

Wondering if themes and plugins should still be able to change these sizes (for now), although that doesn't make much sense either.

This will improve the creation of the srcset attribute as we will have a number of reliable, uniform sizes created for each image, so the browser will have more alternatives when picking which image file to download on the front-end.

Last edited 3 weeks ago by azaozz (previous) (diff)

#3 @azaozz
3 weeks ago

  • Description modified (diff)

#4 @azaozz
3 weeks ago

Thinking more about this, we will probably also need to list what sizes are currently being created and a "Reset to default" button on the Settings => Media screen.

Plugins and themes can change the options, and even after deactivating a plugin or switching to another theme the changes remain. The users should be able to reset that.

#5 follow-up: @joyously
3 weeks ago

Uh, sorry, seems I didn't explain it well and you misunderstood :)

No, I don't think I misunderstood. I'm saying that the user should be able to choose the sizes manually. My theme (and perhaps others) defines the content_width by what the user has already chosen for Large width, since that is what all the images already are sized to. The user knows what his site will need, and what size his images will likely be. WordPress does not.

See this recent forum post: https://wordpress.org/support/topic/resized-images-much-bigger-than-original-ones/

I have never understood why the sizes need to be generated on upload (and mostly never used) when they could easily be served as needed, like in the Dynamic Image Sizes plugin.

#6 in reply to: ↑ 5 @azaozz
3 weeks ago

Replying to joyously:

No, I don't think I misunderstood. I'm saying that the user should be able to choose the sizes manually.

Two things:

  • All current sizes will still be created and be available for the user to choose. This ticket is about reducing pointless options (clutter) on the Settings => Media screen.
  • When using srcset the image size that is selected by the user does not matter. Example: if the user selects "large" size, the browser may download the "medium" size instead if the width of the displayed image is small. The image src attribute is not used by the browser. The srcset is used instead.

I have never understood why the sizes need to be generated on upload (and mostly never used) when they could easily be served as needed, like in the Dynamic Image Sizes plugin.

Unfortunately this is not as easily done as it appears. Depends on the hosting account. I believe there are few (old) tickets for that.

#7 follow-up: @joyously
3 weeks ago

All current sizes will still be created and be available for the user to choose. This ticket is about reducing pointless options (clutter) on the Settings => Media screen.

The options are not pointless. They let the user choose what size the medium and large is. And then themes like mine use those numbers to set the content_width, which drives the rest of the srcset calculations.

When using srcset the image size that is selected by the user does not matter.

Ah, but that is only if nothing is filtering out the srcset. It is optional, you know. And themes do change what is output, including removing it completely. And you are talking about the user choosing a size for an image in a post. But there are lots of other places where those sizes can be used, and the user should still be able to set them, as they can now.

#8 in reply to: ↑ 7 @azaozz
3 weeks ago

Replying to joyously:

They let the user choose what size the medium and large is. And then themes like mine use those numbers to set the content_width, which drives the rest of the srcset calculations.

Hmm, not sure it is such a good idea to base the theme's content_width on the image width. But then it is even worse if the user changes these image sizes. User case:

  • The user installs a theme what gets the width from the image width.
  • The user changes the image width to suit their taste, lets say 600px.
  • In two weeks the user changes their mind and sets the width to 1000px.
  • In another two weeks they change it again to 500px.

What happens with the images and the posts that were published during all these changes? And what happens when the user switches themes? They are stuck with some non-standard images in their older posts...

I mean, as long as there are settings, the users can keep changing them, randomly. How do you support that? :)

When using srcset the image size that is selected by the user does not matter.

Ah, but that is only if nothing is filtering out the srcset. It is optional, you know.

Right. It is optional, but is also a "best practice". Of course themes can decide to mangle it or drop it, but they will be "doing-it-wrong".

...there are lots of other places where those sizes can be used, and the user should still be able to set them, as they can now.

Could you give some examples where images will not benefit from having srcset (i.e. are not used on the front-end or in a web browser), and the usage would benefit of having a particular default WordPress size changed? I mean, if a plugin or a theme is adding some specific use of images, like some of the default themes, it should probably add a custom image size for that specific purpose?

#9 follow-up: @joyously
3 weeks ago

What happens with the images and the posts that were published during all these changes? And what happens when the user switches themes? They are stuck with some non-standard images in their older posts...

Nothing new. This has ever been the situation. At least my theme uses what the user has already chosen instead of introducing a new set of image sizes.

Right. It is optional, but is also a "best practice". Of course themes can decide to mangle it or drop it, but they will be "doing-it-wrong".

It's not necessarily "wrong" if it gives the user what he wanted.

Could you give some examples where images will not benefit from having srcset

I'm not sure I'm following your train of thought here. It's almost as if you are thinking that the Media size options are only used for srcset and therefore we should get rid of them. I'm saying that they could be used for other things that you don't know about, and it does not hurt anything to leave them alone.

#10 in reply to: ↑ 9 @azaozz
3 weeks ago

Replying to joyously:

Nothing new. This has ever been the situation.

Hm, so we should never try to improve that "situation"? :)

It's not necessarily "wrong" if it gives the user what he wanted.

Well, it is quite outdated approach and not "best practice". The users may want to use tables for layout, and they certainly can if they wanted. But it... sucks and makes their sites look really bad :)

I'm not sure I'm following your train of thought here. It's almost as if you are thinking that the Media size options are only used for srcset and therefore we should get rid of them.

Yes, for the last couple of years the image sub-sizes created after uploading an image are primarily used to populate the srcset attribute of the <img> on the front-end. Using a particular size in the editor does not limit the browser to that size like it was with the old src attribute.

I'm saying that they could be used for other things that you don't know about

Right. That's what I was asking above. Could you describe an user case where a particular, hard-coded image size (that is different from the WordPress default) is needed? That user case should allow for the user to change that image size at will, randomly, because this is how these settings work at the moment.

This ticket was mentioned in Slack in #core-media by desrosj. View the logs.


11 days ago

#12 @mikeschroder
11 days ago

Thanks for raising these concerns @joyously!

I'd love to know more about examples of the ways folks are currently using these settings to make sure whatever is next takes that into account.

#13 @karmatosed
11 days ago

I would really like to see these removed. In saying that I absolutely understand all fallbacks and a solid route needs to be worked out, it's something needs assessing but it is something needs doing. I totally agree we need to know the stress cases for this to plan.

A few additional aspects include making sure there's time for this change, education and training materials will need to change for users.

Ultimately though many users don't get what these sizes mean, it's a complication we don't need so let's work out how we as smoothly as possible remove these.

#14 @joemcgill
10 days ago

I also agree that it would be good for us to move away from exposing options for managing a subset of default image resizing settings in the admin menu. These settings were originally added over 10 years ago 😱 in [6952] as a way for site owners to control the display width of images in posts, before WordPress was doing any image resizing of files on upload.

A lot has changed over this amount of time and site owners should no longer need to depend on these options to control the display size of the images on their site. Instead, these options should be set by themes so WordPress knows explicitly how to generate image sizes that are optimized for the display needs of the theme. Ideally, site owners shouldn't need to be concerned with the dimensions of images WordPress is generating for them and instead be given tools to control the intended display (e.g., layout, crops, etc.) for those images and let WordPress (or integrated tools) manage the complexity of generating the appropriate image sizes.

In the spirit of decisions, not options, removing these from the admin reduce the potential for user confusion and mistakes, and gives WP core, theme, and plugin developers a more consistent set of expectations from which to build smarter multimedia optimizations and user experiences.

All that said, after 10 years there are a lot of legacy expectations that we need to be aware of so we can make an informed decision about how to remove this feature. It would be good to collect use cases for how the ability to control these options from the admin are being used so we can evaluate any backwards compatibility concerns we might have missed.

#15 @joyously
10 days ago

You can start finding the uses by running a search for some of the functions in the plugin and theme repos.

#16 @joyously
8 days ago

This related ticket just arrived (wanting more options)

Images: Option to control when to create different image dimensions

#44542

Note: See TracTickets for help on using tickets.