Make WordPress Core

Opened 4 years ago

Last modified 21 months ago

#48489 new defect (bug)

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

Reported by: johnbillion's profile 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 2 years ago.

Download all attachments as: .zip

Change History (8)

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


3 years ago

#2 @pbiron
3 years ago

  • Milestone changed from Future Release to 5.4

#3 @johnbillion
3 years ago

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

#4 @johnbillion
3 years ago

  • Milestone changed from 5.4 to Future Release

#5 @johnbillion
2 years ago

  • Keywords good-first-bug added

@psrpinto
2 years ago

#6 @psrpinto
2 years 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
21 months ago

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