WordPress.org

Ready to get started?Download WordPress

Forums

ImageMagick Engine
Scaling off by 1 pixel (4 posts)

  1. shirshir
    Member
    Posted 1 year 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.

    http://wordpress.org/extend/plugins/imagemagick-engine/

  2. vandorp
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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:

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

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

  4. Matthew Hollett
    Member
    Posted 1 year 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

About this Topic

Tags

No tags yet.