Imagick VS GD
-
Hi,
I recently tried to use a conversion script that converts TIFF to JPEG that tries to use the wp_get_image_editor, however while the Media Cloud plugin was active it threw an error that it was unable to convert the image.
After some extensive debugging I noticed that the default WordPress “WP_Image_Editor” is being overriden by your plugin with a class called “StorageImageEditor”.
I’m wondering why in your classes/Tools/Storage/StorageImageEditor.php your are using the following line:$this->imageEditor = (\WP_Image_Editor_GD::test()) ? new \WP_Image_Editor_GD($file) : new \WP_Image_Editor_Imagick($file);
Why are you checking for GD before Imagick? WordPress uses it the other way around since Imagick has a lot more available functions, one of which allows conversion from TIFF to JPEG, and that’s what was causing my issue.
My suggestion is that you change this line the other way around to:
$this->imageEditor = (\WP_Image_Editor_Imagick::test()) ? new \WP_Image_Editor_Imagick($file) : new \WP_Image_Editor_GD($file);
That way all functionality of WordPress that uses Imagick should work as expected instead of not working anymore.
Thanks in advance if you fix this, and thanks for a great plugin!
The topic ‘Imagick VS GD’ is closed to new replies.