Make WordPress Core

Opened 4 years ago

Last modified 4 years ago

#50200 new defect (bug)

Media library thumbnails broken for certain aspect ratio images in Firefox

Reported by: jussitrival's profile jussitrival Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.4.1
Component: Media Keywords:
Focuses: ui, administration Cc:


Recently a client reached out to me about broken images in WordPress dashboard.
Turns out media library can't load thumbnails for certain aspect ratio images.
The images are generated though and exist on the server (I looked up the image source with dev tools and checked if the image actually was generated and yes there it was).

So I made a few tests on live and test environments. These are the image sizes that cause the thumbnails to break:


Both 235x591 and 240x591 work fine as expected. My client was uploading images using the size 236x591.

Now the issue is not only with those pixel sizes as I tried doubling the image size as well. Doubling 237x591 to 474x1182 also breaks the thumbnail so it's more like aspect ratio bug than just the image size.

The images load fine on frontend but there is a problem in the admin panel when editing posts and adding these media files to a post (only shows white box and doesn't load image).

I have tried this on fresh install of WordPress with Twenty Twenty and no plugins installed. Bug happens on stable 5.4.1 as well as alpha version of 5.4.2 and 5.5
All of my tests were done through HTTPS protocol.

Happens on PHP version 7.2 and 7.3

Bug appears on Firefox version 76 but it does not appear on Chrome version 81 or Microsoft Edge version 44

I have not tested any other aspect ratios.

Attachments (2)

media-library.jpg (232.2 KB) - added by jussitrival 4 years ago.
Broken thumbnail in media library
new-article-bug.jpg (297.4 KB) - added by jussitrival 4 years ago.
Broken image when writing new post

Download all attachments as: .zip

Change History (3)

4 years ago

Broken thumbnail in media library

4 years ago

Broken image when writing new post

This ticket was mentioned in Slack in #core-media by antpb. View the logs.

4 years ago

Note: See TracTickets for help on using tickets.