[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
Mon Dec 2 01:51:03 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:
-------------------------------------------------+---------------------

Comment (by azaozz):

 Replying to [comment:3 vanyukov]:
 > I think it's a bit wrong, at least, from the original intention. Images
 are upscaled up to smooth out the edges during resizing. If we have a 5x
 larger image - just skip resample and resize, if we don't - resample the
 original and ''then'' resize.

 Hmm, I read the comment there differently :)

 "To be more efficient..." sounds like this is done in order to help
 efficiency, i.e. create a much smaller sub-size faster and using less
 server resources. Not sure if the idea was to upscale the original in
 order to produce "smoother" sub-size. The existing code suggests that too.
 Also think `Imagick::thumbnailImage()` does something similar internally.

 The `Imagick::sampleImage()` seems like a "fast" scaling method:

  SampleImage() scales an image to the desired dimensions with pixel
 sampling. Unlike other scaling methods, this method does not introduce any
 additional color into the scaled image.

 I'm sure @mikeschroder and @joemcgill will know more.

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


More information about the wp-trac mailing list