WordPress.org

Ready to get started?Download WordPress

Forums

ImageMagick Engine
Crop with cut? (6 posts)

  1. alx359
    Member
    Posted 3 years ago #

    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/

  2. alx359
    Member
    Posted 2 years ago #

    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
  3. Clinton Agency
    Member
    Plugin Author

    Posted 2 years ago #

    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).

  4. alx359
    Member
    Posted 2 years ago #

    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].

  5. Clinton Agency
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  6. alx359
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic