[wp-trac] [WordPress Trac] #32437: Uploaded images are still saved as a "resized" duplicate

WordPress Trac noreply at wordpress.org
Thu Jun 6 00:24:50 UTC 2019


#32437: Uploaded images are still saved as a "resized" duplicate
--------------------------+-----------------------------
 Reporter:  wpdennis      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Media         |     Version:  4.2
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+-----------------------------

Comment (by azaozz):

 Confirmed this while working on #40439. It is currently fixed in
 https://core.trac.wordpress.org/attachment/ticket/40439/40439.4.diff but
 wondering what's the right way to handle it.

 1. When the user uploads a non-edited photo, we need to optimize it. The
 file size is dramatically reduced. Testing with a few 4128 x 3096 photos
 (standard smartphone camera), the size goes from ~4.2MB to ~1.5MB.

 2. At the same time when the user uploads an edited and optimized image,
 the GD/Imagick processing may make it larger and with poorer quality.
 Testing with an optimized 1024x768 JPEG image, the original is 98KB and
 the resulting "large" size image is 121KB and slightly pixelated (when
 viewed on a 2x screen).

 The second case seems quite more common. Virtually all digital cameras
 nowadays produce large images that are not suitable for web use. To
 account for both cases, thinking we should add a threshold above which
 images will be optimized when they match one of the defined sizes. A good
 spot to start optimizing is perhaps above 3MP (2048x1536), or maybe even
 5MP (2560x1920).

 This means that when there is a defined size larger than 2048px, and an
 uploaded image matches that size, we will still produce a resized image
 suitable for web use (in this case "resized" means with reduced file size,
 not dimensions).

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


More information about the wp-trac mailing list