ImageMagick Engine
Scaling off by 1 pixel (4 posts)

  1. shirshir
    Posted 3 years ago #

    Sometimes the plugin produced scaled down images with dimensions that were off by 1 pixel. Setting the bestfit parameter of the Imagick::scaleImage method to false resolved this in my situation.


  2. vandorp
    Posted 3 years ago #

    I have the same problem. It must have to do with rounding errors. I already tried to change the width of my theme from 625 to 624 (as 624 is dividable by 1.5, the aspect ratio of all my images), but that does not work in all cases, it depends on the size of the original images as well.

    I assume you modified the code to get this working. Can you tell me where? Are you using the CLI or PHP interface from the plugin to ImageMagick?

  3. shirshir
    Posted 3 years ago #

    I am using the PHP interface. The change (for version 1.40) is in file imagemagick-engine.php, function ime_im_php_resize(), line 436:

    $im->scaleImage($width, $height, true);

    $im->scaleImage($width, $height, false);

  4. Matthew Hollett
    Posted 3 years ago #

    This is happening for me as well. WordPress is generating a file called "Image-138x85" that is actually 137 x 85 pixels. I used the fix that shirshir posted and it is working properly now.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • ImageMagick Engine
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.