[wp-trac] [WordPress Trac] #48842: Fix calculation error when resampling images before resizing in class-wp-image-editor-imagick.php

WordPress Trac noreply at wordpress.org
Sat Nov 30 20:34:20 UTC 2019


#48842: Fix calculation error when resampling images before resizing in class-wp-
image-editor-imagick.php
-------------------------------------------------+---------------------
 Reporter:  azaozz                               |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  high                                 |   Milestone:  5.3.1
Component:  Media                                |     Version:  4.5
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch 2nd-opinion needs-testing  |     Focuses:
-------------------------------------------------+---------------------
Changes (by azaozz):

 * keywords:   => has-patch 2nd-opinion needs-testing
 * priority:  normal => high


Comment:

 In 48842.diff: fix the calculation in
 `WP_Image_Editor_Imagick::thumbnail_image()` when resampling an image
 source before resizing it to a much smaller size.

 With this change:
 - Resizing a 1000x500 image to 300x150 doesn't resample the source
 (`$resize_ratio` is `2.25`).
 - Resizing a 3000x1500 image to 300x150 doesn't resample the source
 (`$resize_ratio` is `0.25`).
 - Resizing a 4800x2400 image to 300x150 resamples the source
 (`$resize_ratio` is `0.09765625`).

 Setting to high priority as this needs to be reviewed and committed asap
 :)

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


More information about the wp-trac mailing list