Skip to content
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

Featured image uses wrong default size #15842

Closed
derweili opened this issue May 27, 2019 · 2 comments · Fixed by #15844
Closed

Featured image uses wrong default size #15842

derweili opened this issue May 27, 2019 · 2 comments · Fixed by #15844
Labels
[Feature] Document Settings Document settings experience Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts [Package] Editor /packages/editor [Type] Bug An existing feature does not function as intended

Comments

@derweili
Copy link
Contributor

Describe the bug
By default gutenberg tries to load the featured image with the image size post-thumbnail in the editor sidebar:

const mediaSize = applyFilters( 'editor.PostFeaturedImage.imageSize', 'post-thumbnail', media.id, currentPostId );

This image size does not exist by default. The correct image size would be thumbnail.
See the default image sizes in the Codex: https://codex.wordpress.org/Post_Thumbnails#Thumbnail_Sizes

Because the specified image size does not exist, the full size is used as a fallback.
This causes a performance issue, because a potentially far too large image is loaded.

To reproduce
Steps to reproduce the behavior:

  1. Create a Post
  2. Add a Featured image in a large size e.g. 2000px wide
  3. Right-click on the image and choose "open image in new window"
  4. You can see the image in full size.

Expected behavior
The Featured image should be loaded in a smaller version/thumnail site within the editor sidebar.

Desktop:

  • OS: OS X 10.13.6
  • Browser Chrome
  • Version 74.0.3729.169

Additional context

  • Gutenberg Version 5.8.0-rc.1
@derweili derweili changed the title Featured image wrong default size Featured image uses wrong default size May 27, 2019
@derweili
Copy link
Contributor Author

derweili commented May 27, 2019

I think there should be a discussion which image size should be used in the editor sidebar.
Maybe medium is better than thumbnail because it's not cropped by default but i think that neither post-thumbnail nor the full size should be used by default.

@nerrad nerrad added [Feature] Document Settings Document settings experience [Type] Bug An existing feature does not function as intended Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] Editor /packages/editor labels May 27, 2019
@senadir
Copy link
Contributor

senadir commented Jun 3, 2019

WordPress uses medium size by default in the old editor so I think this should be respected in gutenberg as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Document Settings Document settings experience Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts [Package] Editor /packages/editor [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants