Making WordPress.org

Opened 10 months ago

#7401 new defect (bug)

Portrait oriented images are pixelated on directory listing pages

Reported by: desrosj's profile desrosj Owned by:
Milestone: Priority: normal
Component: Photo Directory Keywords:
Cc:

Description

When browsing photos in the directory, some images were standing out to me because they appeared blurry. It seems that portrait images are receiving an image size that's too small, but the issue only affects lower or normal resolution displays (not high density or 2x).

As an example, here's the image tag for one of the affected images (line returns added by me to make the tag more readable):

<img class="grid-photo"
src="https://pd.w.org/2024/01/103659ee838f017c4.47394712-225x300.jpg"
srcset="https://pd.w.org/2024/01/103659ee838f017c4.47394712-225x300.jpg, https://pd.w.org/2024/01/103659ee838f017c4.47394712-768x1024.jpg 2x"
height="200"
width="300"
alt="A brown praying mantis with a green stripe on its body sitting on a stone wall looking towards the camera. The green stripe is in focus, and its face is slightly out of focus."
loading="lazy"
decoding="async">

Notice how the width and height are set to 300x200 in the corresponding image tag attributes (the actual display size in the browser), but the default and 1x sources are being sent as 225x300. The 2x image source is 768x1024, which is slightly larger than required (600x400), so there's no blurriness on high resolution screens.

Change History (0)

Note: See TracTickets for help on using tickets.