-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Image Block rendered image in the editor doesn't match the rendered image on the frontend #24970
Comments
This is an interesting bug. The image is output with proper So this is tricky. We could, off the top of my head:
I'm not familiar with the history of the image block interface, but no.3 makes the most overall sense to me. Is there anything I missed here? I didn't see this in the other issues linked above, but I think they may boil down to the same thing. |
I can still reproduce this issue on Gutenberg 13.8.1 WordPress 6.0.1 Twenty Twenty Two theme Screen.Recording.2022-08-05.at.23.24.06.mov |
I just tested this again today with the Gutenberg plugin version 15.8.1. This is still valid. |
This issue is similar to #12914 and #12277 . Tackling this could fix many other issues like #17685 and #12168
Describe the bug
Image Block is different in the editor and on the frontend if the width and height are changed to a different aspect ratio other than the original. For example, changing 750x750 image to 250x500 causes it to be stretched in the editor, but still, be square on the frontend.
To reproduce
Steps to reproduce the behavior:
Open block editor
Add Image block
Upload/Select a square image (for example 750x750) (this bug is not tied to this specific aspect, I just want to make sure the reproduction steps will lead to the same results)
Change the width to 250 ( you will see width = 250, height = 750, which is already strange since the rendered image is square)
Change the height to 500 ( you will see width = 250, height = 500)
Now the image is stretched vertically in the block editor
Save
Open frontend and see the image is still square
Expected behavior
Rendered image in the block editor and on the frontend should match.
Editor version (please complete the following information):
Confirmed in WP 5.5 Core (no plugin) and WP 5.5 Gutenberg: 8.9.0-rc.1
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: