[wp-trac] [WordPress Trac] #57003: Compress original image upload to avoid uncompressed images

WordPress Trac noreply at wordpress.org
Mon Nov 7 22:19:29 UTC 2022


#57003: Compress original image upload to avoid uncompressed images
-------------------------------------------------+-------------------------
 Reporter:  flixos90                             |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Media                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  2nd-opinion needs-patch needs-unit-  |     Focuses:
  tests                                          |  performance
-------------------------------------------------+-------------------------

Comment (by azaozz):

 Replying to [comment:1 flixos90]:
 > it appears we simply do not generate a scaled-down PNG because the image
 could be larger.

 Correct. WP doesn't try to scale large PNGs because the resulting images
 usually have larger file size, sometimes significantly (1.5 - 2 times)
 larger. Scaling of PNGs with (some versions) of GD and ImageMagick seems
 to be somewhat problematic.

 > Shouldn't we introduce a file comparison check like I'm proposing here
 in any case? This way we could potentially remove that condition to not
 attempt PNG downscaling and instead make a decision afterwards which image
 is "better".

 Yes, that would be nice. However thinking the post-processing of PNGs
 would need to be improved as much as possible first. Then this
 functionality should depend on removing the image post-processing
 bottleneck, same as above.

 Just FYI: the PNGs that exceed the `big_image_size_threshold` are quite
 rare. Such large PNGs (over 2560px) are simply not useful. Even had
 trouble finding "real life" images to test with.

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


More information about the wp-trac mailing list