[wp-trac] [WordPress Trac] #48736: Exclude PNG images from scaling after upload

WordPress Trac noreply at wordpress.org
Thu Nov 21 20:06:45 UTC 2019


#48736: Exclude PNG images from scaling after upload
-------------------------------------+---------------------
 Reporter:  azaozz                   |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  5.3.1
Component:  Upload                   |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  2nd-opinion needs-patch  |     Focuses:
-------------------------------------+---------------------

Comment (by azaozz):

 Replying to [comment:4 rmens]:
 > The handling of PNG images needs more checking.

 Yep, I agree, opened this ticket for that.

 > We run a large managed hosting platform for publishers with 60+ editors
 working daily with press and stock photo's and saw our average CPU load
 increase by 9 percent.

 Could you provide some more info about this, if possible? In particular,
 was that increase seen only when post-processing uploaded images or was it
 an overall increase after updating to WP 5.3?

 > Bandwidth is cheap, CPU and inodes are not.

 Bandwidth may be "cheap" in some cases, but may also be "quite expensive".
 Overall it is more expensive that "disk storage".

 > Images are mostly already served in a way that doesn't hurt the reader,
 for example with responsive images. With that already baked in WordPress
 original images never get served.

 Right. The changes in WP 5.3 expand and enhance WordPress' ability to
 serve images better. Generally the change was to add up to three larger
 image sub-sizes. This was done to support more devices with larger screens
 and/or high-density displays. Inside WordPress the largest size is also
 set as the "full" size. This ensures that original images are never used
 when they are "too big" for web use.  There is a filter to control what
 the "too big" threshold is.

 However it seems that PHP (GD and ImageMagick) do not handle
 resizing/scaling of very large PNG images well. So this ticket is to
 (temporarily?) turn off replacing the "full" size image with a scaled down
 version, and use the originally uploaded image as before.

 I'm also thinking that more testing/consideration is needed on whether to
 create large sub-sizes for PNGs at all. Seems in some cases even a 1024px
 PNG can have very large file size, 2MB and over, when resized from PHP.

 It would be great if you can provide some examples/more info/more testing.
 :)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48736#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list