-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the large image size when inserting from the media library. #6945
Conversation
For performance, avoid using the full size image by default when inserting an image. Note that the media object from the media library will include a `url` property for each image size, while media objects build returned by the REST API via the mediaUploader component will have a `source_url` property instead, so this needs to cover both cases.
IIRC, isn't the default meant to be a user preference saved between sessions based on the last explicitly set image size? |
There is a |
Looks like this needs a refresh since #6960 landed. |
I believe @azaozz is working on a similar PR to add |
@iseulde Can you point me to where I can learn more about this? Given each image size can have different crop proportions, I'm curious how |
Not any more :) There is no point in showing "image sizes" based on the file sizes created on uploading an image. If it is really needed, we can have some sizes defined in the media modal so the user can pick one, but they have been missing in Gutenberg from the beginning, and I think this is the right way to do this. If the users want to resize the images, using the 25-50-75-100% buttons are a much better option. Another one is using the resize handles. However these buttons and handles will have to work on the visible dimensions of the images, not the (irrelevant) physical file size, i.e. in percentage of the actual visible image and not in pixels of the image file.
The Generally in WP only the thumbnail sub-size is cropped. Some themes and plugins may add other cropped sub-sizes that are not proportional to the original image. All of these are excluded when generating the srcset (see |
Updated the comment. The word "unless" was missing. |
Is there still a relevancy / desire to continue the work here? |
Closing as stale without response. It can be reopened if development is expected to continue, or a new pull request can be submitted. |
Description
For performance, avoid using the full size image by default when inserting an image. Note that the media object from the media library will include a
url
property for each image size, while media objects build returned by the REST API via the mediaUploader component will have asource_url
property instead, so this needs to cover both cases.See #6177.
How has this been tested?
Tested by adding and selecting an image via both the media uploader and the wp.media modal and checking to see that the large size was selected rather than the full size.
Types of changes
Checklist: