WPThumb icon indicating copy to clipboard operation
WPThumb copied to clipboard

Imagick never used as editor

Open sleepingkiwi opened this issue 9 years ago • 0 comments

Currently the Imagick editor will only be used if GD is not available for some reason. Given that GD is pretty much a given with most PHP installs this effectively means ImageMagick won't ever be used.

This may be intentional? If it is then please feel free to close this issue, but I'd have expected WPThumb to work similarly to WP core where ImageMagick is used as a preference whenever it's available.

The function used by WordPress to return an appropriate image editor (https://core.trac.wordpress.org/browser/tags/4.2.2/src/wp-includes/media.php#L2558) simply returns the first editor to match all provided arguments, because WPThumb sets WP_Thumb_Image_Editor_GD as the first editor to be checked against it will almost always be returned.

The issue is caused by the order you add the editors to the $editors array right at the bottom of wpthumb.php. It would be a quick fix to swap the order which would make WP_Thumb_Image_Editor_Imagick the default if it's available.

I'd be happy to make a PR for that change if it would help?

sleepingkiwi avatar Jun 03 '15 14:06 sleepingkiwi