Make WordPress Core

Opened 15 months ago

Closed 15 months ago

Last modified 14 months ago

#51294 closed defect (bug) (duplicate)

Image core block doesn't show the images properly

Reported by: palfizsolt Owned by:
Milestone: Priority: normal
Severity: major Version: 5.5.1
Component: Editor Keywords:
Focuses: Cc:


In the editor the core image block shows the images correctly, but when it renders the photo on the target the aspect ratio is bad.

Steps to reproduce:

  • Create a post and add an image block
  • choose a big image from the media library
  • see the preview of the new post, the image ratio will be bad

Reason of the issue:
The height html property is defined in the <img>, but the width property is overwritten with the wp-block-image style to max-width:100%.

Possible fix of the issue:
Remove the height and width property from the <img>

The issue is occurs only the image is linked from the media libary. There is no issue with external (URL) images. There was not this issue in the previous version of WordPress.

Change History (3)

#1 @joyously
15 months ago

I think this is being tracked in #50909.
Your theme is apparently not quite correct for responsive images, and needs
img {max-width:100%; height:auto;}
(several of the default themes do not have this CSS)

#2 @palfizsolt
15 months ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #50909.

Yes, this is a same issue, what you linked. This ticket can be closed.

#3 @SergeyBiryukov
14 months ago

  • Milestone Awaiting Review deleted

Thanks for the follow-up!

Note: See TracTickets for help on using tickets.