WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 7 weeks ago

#48489 new defect (bug)

Big image size threshold should take into account registered image sizes.

Reported by: johnbillion Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 5.3
Component: Media Keywords: good-first-bug has-patch
Focuses: Cc:

Description

The "big image" upper size threshold is set to 2560. If an image size is registered that has a width or height larger than this, then the image will be unexpectedly cropped to 2560.

The value that gets passed through to the big_image_size_threshold filter should be set to the maximum value of either 2560 or the largest width or height from all registered image sizes.

Attachments (1)

48489.diff (1.9 KB) - added by psrpinto 5 months ago.

Download all attachments as: .zip

Change History (8)

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


22 months ago

#2 @pbiron
22 months ago

  • Milestone changed from Future Release to 5.4

#3 @johnbillion
21 months ago

  • Focuses performance removed
  • Keywords needs-patch added; dev-feedback removed

#4 @johnbillion
21 months ago

  • Milestone changed from 5.4 to Future Release

#5 @johnbillion
8 months ago

  • Keywords good-first-bug added

@psrpinto
5 months ago

#6 @psrpinto
5 months ago

I submitted a patch which implements the solution suggested in the ticket description:

The value that gets passed through to the big_image_size_threshold filter should be set to the maximum value of either 2560 or the largest width or height from all registered image sizes.

However, I noticed that many of the default themes (e.g. twentytwentyone, twentytwenty, twentynineteen) set the post_thumbnail_size's height to 9999, which results in the threshold now being 9999.

This means the majority of pictures will not be cropped, and I'm not sure that was the intention behind the proposed solution.

Do you think such a high threshold makes sense @johnbillion?

#7 @karpstrucking
7 weeks ago

  • Keywords has-patch added; needs-patch removed
Note: See TracTickets for help on using tickets.