Sometimes you'll see image uploads in WordPress failing with "http error", this is often due to the image size or the image complexity causing the image processing engine ImageMagick to crash due to memory usage.
WordPress has always decided to prefer the Imagick PHP library over the GD library because it offers a bit more features such as generating previews for PDFs, however, this comes at the cost of higher CPU and/or memory usage.
If you do not need the specific Imagick features, then we always recommend using GD, since it's way more efficient especially with large images.
In your functions.php for your theme, you can add the following code, which will change the priority of the image libraries.
add_filter( 'wp_image_editors', 'prefer_gd_over_imagick' );
function prefer_gd_over_imagick($array) {
return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
}
Comments
0 comments
Please sign in to leave a comment.