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

Gallery Image resolution selector displays as Thumbnail even if the image actual size is Full Size #68969

Open
4 of 6 tasks
Kallyan01 opened this issue Jan 30, 2025 · 4 comments · May be fixed by #68968
Open
4 of 6 tasks
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Block] Image Affects the Image Block [Type] Bug An existing feature does not function as intended

Comments

@Kallyan01
Copy link

Kallyan01 commented Jan 30, 2025

Description

Whenever I try to add a gallery image in the Gutenberg editor, the selected image appears in Full Size, but in the resolution selector, it shows as Thumbnail Size. The expected behaviour is that the selector should reflect the chosen Full Size image.

Image

Expected Behaviour:
The image preview in the media selector should show the actual image size (Full Size).
Actual Behaviour:
The media selector displays the image in Thumbnail Size, even when the actual inserted image is in Full Size (according to the image resolutions ).

Step-by-step reproduction instructions

  • Open any POST or PAGE.
  • Add a Gallery block.
  • Choose an image through upload or media library .
  • When an image is inserted into the editor, observe that the selected image appears in Full Size in the gallery, but in the media selector, it incorrectly displays as Thumbnail Size.
  • Check image resolution by page inspect and notice the difference .

Screenshots, screen recording, code snippet

Image
Screen.Recording.2025-01-30.at.8.53.27.PM.mov

Environment info

WordPress Version: 6.8
Gutenberg Version: 20.2.0-rc.1
Theme: Twenty Twenty-Four
Browser: Chrome
OS: Mac

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@Kallyan01 Kallyan01 added the [Type] Bug An existing feature does not function as intended label Jan 30, 2025
@Kallyan01 Kallyan01 linked a pull request Jan 30, 2025 that will close this issue
@Kallyan01
Copy link
Author

What i observed is that the default value of imageDefaultSize is set to "large", but "large" is not available in the image resolution options. As a result, the gallery block is defaulting to an unintended size, causing images to be displayed as thumbnails instead of their actual full size.

To fix this, I tried modifying the imageDefaultSize value in packages/block-editor/src/store/defaults.js, but the change is not reflecting in the store.

Could this be due to caching, state persistence, or an override elsewhere in the Gutenberg editor? Any insights on why the store value is not updating would be appreciated!

@Mamaduka
Copy link
Member

The store values come from the server; it's a global setting and shouldn't be modified for a single block case.

Alternative: Update logic for picking image size based on default and fallback to full width when imageDefaultSize isn't available for media.

@Mamaduka Mamaduka added [Block] Image Affects the Image Block [Block] Gallery Affects the Gallery Block - used to display groups of images labels Jan 30, 2025
@Mamaduka
Copy link
Member

Mamaduka commented Feb 1, 2025

@Kallyan01, what's the image resolution you're using for testing? I'm having trouble reproducing the bug.

@Kallyan01
Copy link
Author

@Mamaduka it's 640x631 !
here is the file

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Block] Image Affects the Image Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants