Warm tip: This article is reproduced from serverfault.com, please click

How to override "Suggested maximum size is 2500 pixels" on media upload page

发布于 2020-10-01 14:05:28

My client needs to upload high-res images for her online press kit.

She is getting this error: "Post-processing of the image failed likely because the server is busy or does not have enough resources. Uploading a smaller image may help. Suggested maximum size is 2500 pixels."

The images she wants to upload are about 2.5MB in size, and are 4272 x 2848 with 72dpi.

If I crop the images, to be 2500x1667 at 72dpi, they upload fine (meeting the 2500 pixel suggested max size.)

Is there a way to allow the larger pixel images as indicated above (4272 x 2848)?

I am not sure which php setting is the issue - I think it might be memory size, but if it is, I am not sure where to change it or what amount to set it to, to allow twice the pixel max size allowance (going from 2500 to say 5000 pixels)... or if that is even allowed.

Any help would be appreciated.

Here are my system details:

  • WordPress Version: 5.5.1
  • MySQL Version: 5.6.41
  • BootStrap Version: 3.3.1
  • PHP version 7.3.22 (Supports 64bit values)
  • PHP max input variables 1000
  • PHP time limit 30
  • PHP memory limit 256M
  • Max input time 60
  • Upload max filesize 256M
  • PHP post max size 260M

Thanks!

Questioner
SunnyOz
Viewed
0
04FS 2020-10-01 22:24:16

You can use the big_image_size_threshold filter to change or disable this behavior.

https://developer.wordpress.org/reference/hooks/big_image_size_threshold/

If the original image width or height is above the threshold, it will be scaled down. The threshold is used as max width and max height. The scaled down image will be used as the largest available size, including the _wp_attached_file post meta value.

Returning false from the filter callback will disable the scaling.