WordPress.org

Support

Support » Plugins and Hacks » ImageMagick Engine » [Plugin: ImageMagick Engine] Crop with cut?

[Plugin: ImageMagick Engine] Crop with cut?

  • First, thanks for this nice and powerful plugin!

    When using default WP, I have the option to have the thumbnails cropped exactly, cutting in part of the image if necessary. But this plugin does not crop the images that way, it resizes them smaller and adds white fields. How to achieve the cropping with cutting as per WP? (tweaking code is fine with me).
    Cheers,

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Okay, after some debugging and googling, it become clear this is actually a bug. Crop works as expected (cutting to fill) but not in Windows. The reason is the pertinent flag that’s already there needs to be additionally escaped to make it work on Win.

    in imagemagick-engine.php li ~502 add this line:

    if ($crop) {
    	//[alx359]. Added. Escape as ^^, to ensure the geometry option flag works on Windows
    	//ref: http://www.imagemagick.org/Usage/resize/#fill
    	if(PHP_SHLIB_SUFFIX == 'dll') $cmd .= "^";
    
    	$cmd .= "^ -gravity center -extent {$width}x{$height}";
    }
    else
    	$cmd .= "!"; // force these dimensions

    Thanks for the detailed report!

    I’ve reworked the fix slightly (move OS test to a separate function), and will release once I’ve gotten some confirmation that it works. It is currently available as the development version (http://downloads.wordpress.org/plugin/imagemagick-engine.zip).

    It works, but not as expected.

    The beta:
    – The path option is giving me now a red cross. Was green and working in the stable.
    – ‘ImageMagick PHP module’ says check-green, but when saving config as this, it doesn’t work [visually, ‘regenerating images’ progress bar stucks at 0% and doesn’t move].
    – Saving as command-line (even if red-marked) it starts working and renders fine. But the state of ‘Image engine’ dropdown, visually switches back to ‘ImageMagick PHP module’, so it’s confusing what’s actually going on.

    The stable:
    – The command-line option is check-green for me. When saved as this, it remembers state and works fine with the fix.
    – The ‘ImageMagick PHP module’ option also shows check-green, but it doesn’t work for me [Win7].

    Thanks for testing! I might have to set up a Windows test environment if this keeps up…

    The command line handling should be fixed in new beta (-beta2) which should be available as development version here in a few minutes.

    As for the Imagick module errors: it probably means you do not have all required image format libraries installed, or at least that the php module cannot find them.

    I’ve been meaning to test for this, so if you’re able to help out I might have a version to test later.

    The command-line issue is fixed now. Thanks very much!

    The ‘PHP module’ is still not working for me, but most probably you’re right.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: ImageMagick Engine] Crop with cut?’ is closed to new replies.
Skip to toolbar