in Image Block the image size in drop down is not proper as per image dimension
Describe the bug in Image Block the image size in drop down is not proper as per there dimension
Steps to reproduce the behaviour:
- Go to 'Editor'
- Add new page
- Click on 'add block'
- Select the block 'Image'
- Add images in Image block
- View the options of 'Image size' drop down
- See error
Expected behaviour selection of image size in drop down should be as per image dimension
Video for more detail please view the attached video https://www.loom.com/share/856447be04f644939b184032969d5de8
Editor version: WordPress version: 5.6-RC1
Desktop: OS: Windows Browser chrome Version 86.0.4240.193 (Official Build) (64-bit)
Thank you very much for adding this issue, @kmadhak Kunal!
I am testing on a Mac running OSX 10.15.7 WordPress 5.6 Gutenberg plugin 9.5.2. Themes: Twenty Twenty One as well as Twenty Twenty
I made a new page. Clicked the inserter. Added an Image block. Added an image with dimensions 2560 x 1707. It came in as a Large image (not thumbnail).
I tested another image with dimensions 1600x1200. It came in as a Large image.
Deactivating the Gutenberg plugin. I see the same result.
Please retest and let us know how it is working. Do also test out Twenty Twenty or Twenty Twenty One themes to see if you get the error there. Then test the theme you are using to see if there is any difference.
Thank you!
Hello @paaljoachim paaljoachim,
Thanks for the replay.
I have checked with the WordPress version 5.6 in a theme "Twenty Twenty One" and "Twenty Twenty" and it is regenerating, for more detail please view the attached video.
Video with Twenty Twenty One theme: https://www.loom.com/share/c174a279a3db4ceca27916ddb6ce4a01
Video with Twenty Twenty theme: https://www.loom.com/share/46d25802113a41bfa9873f7f538f2fbf
Please look into it and let me know if you have any query.
Thank you.
Thank you @kmadhak Kunal! I now understand! This is a bug. Thank you for reporting it! I will also need to see if this has been reported before. By searching for Image block here on the Gutenberg repo and checking out various issues.
Some examples. Adding a 1754x1240 image. Shows Image size as Large.
Adding a 758x411 image. (I also tried with a 600x600 image with the same result.) Shows Image size as Thumbnail but the Gutenberg layout preview shows the image as Full Size. This can clearly be seen when changing the Image sizes.

Using theme Twenty Twenty. WordPress 5.6 Gutenberg plugin 9.5.2.
Btw We will also need to add a new bug report for the Replace panel that shows the horizontal scrollbar. That is added here: https://github.com/WordPress/gutenberg/issues/27788
I ran into this issue today. Running 5.7 with a child theme of Twenty Twenty.
It feels like it might be a regression from #21681
Thanks for reporting it, Mark!
@jeyip Jeremy. Using WordPress 5.7 Twenty Twenty theme. No active plugins.
I went to an existing page. Added the Image block. Added an image at 539x554. The layout showed a large image, but the drop down said thumbnail. I changed to a large in the drop down and noticed no change in the layout. Then changed to thumbnail in the drop down and noticed the layout change the image to a thumbnail size.
Bottom line as I noticed it is that adding a smaller image. The layout will show a large image but the drop down will say thumbnail.
Same issue here, was fixed before in https://github.com/WordPress/gutenberg/issues/21681. Also can I just check, should the sizes in the image block for Thumbnail, Medium, Full Size be the same as in WordPress > Media settings or are they different sizes unique to the block? On my installation they don't match.
I also noticed this and was able to track down the source of the issue.
Incorrect image size is selected when WP doesn't generate an image for the default size, and usually, this is a large. But the block will still use this default image size to set the sizeSlug attribute.
The ImageSizeControl only includes sizes available for the media + "Full Size". When the "Large" image isn't available, but sizeSlug points to it, control will fall back to the first option - "Thumbnail."
TL;DR - If WP didn't generate the default image size, the ImageSizeControl should fall back to "Full Size."
I'm not sure what's the best solution for this, but I will create PR as soon as I've something.
PR is ready for testing #32364.
Hello @George Mamadashvili,
Greetings of the day!!!
I would like to know the progress of this issue, please let me know if you need more detail on it.
Thank you.
Hi, @kmadhak
The PR is ready and waiting for a review.