Skip to content

Featured image uses wrong default size #15842

@derweili

Description

@derweili

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueAn issue that's suitable for someone looking to contribute for the first timeNeeds DevReady for, and needs developer efforts[Feature] Document SettingsDocument settings experience[Package] Editor/packages/editor[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions