Post-processing of the image failed (Live Edit)

Five ways to fix the “Post-processing of the image failed” error in WordPress

[convertkit form=1322251]

(Estimated Read Time: 5-10 Minutes)

You might have received an error in WordPress when attempting to upload images to the media library. It would go to the tune of something like:

Post-processing of the image failed likely because the server is busy or does not have enough resources. Uploading a smaller image may help. Suggested maximum size is 2500 pixels.

It’ll look something like this:

Post-processing of the image failed (Media Library)
Here’s how that looks when you try to upload files directly into the media library from the WordPress dashboard
Post-processing of the image failed (Live Edit)
And here’s what the problem looks like as you’re trying to create a page or post live.

This tutorial teaches you how to fix it quickly.

What does “Post-processing of the image failed” mean, and why does it happen?

WordPress processes every image uploaded to it to create smaller versions that can be responsively displayed on smaller devices such as tablets or mobile phones. This helps save on data charges when users load your website as well as improve page speed times.

However, this “post-processing” done after the upload is done on the web server where your image is uploaded, and this is where the problem lies: your web server doesn’t have enough memory and processing resources allocated to it to allow it to process images that are too large.

It may also be because your hosting provider places caps on the I/O usage of your web server, and when you try to upload very high-resolution images, you quickly reach your I/O cap and WordPress is unable to proceed further with any image processing, throwing you this error. This is typical for shared web hosting plans, and if this is the cause of your problem you will have to migrate to a more robust hosting plan where this limitation is not an issue. (We have that, by the way.)

You Need To Diversify Your Hosting

TL;DR


Or, the other possibility why this “Post-processing of the image failed” error is appearing may be that the post-processing of your image is taking too long, and the script that WordPress is trying to run to do the post-processing of the image is timing out, because your server settings are configured to give scripts a certain amount of time to finish before the server cuts them off.

How to fix it

1. Try the GD Editor fix by altering the functions.php file.

Based on this handy little post here, you can add the following code to the functions.php file in your wp-includes folder within your WordPress installation:

function use_gd_editor($array) {
	return array( 'WP_Image_Editor_GD', );
   }
   add_filter( 'wp_image_editors', 'use_gd_editor' );

This will probably fix your problem right away. In case it doesn’t, keep reading and try the other methods listed below.

2. Compress your images before uploading them.

Use any kind of software that compresses the image file size, if you’re uploading a very large uncompressed JPEG image that might be 5 megabytes or larger.

3. Upload your images individually, one at a time.

Uploading images individually allows the server to free up memory resources that were used to process the previous image, which frees those resources up to process the next image being uploaded.

4. Lighten the load on your web server.

Better yet, remove extra web applications and other installations that may be occupying server resources and memory.

Don’t use one server to host multiple WordPress installations, for example. Each one will occupy a set amount of server space and make your server bloated.

Every time you add an extra installation on a server with finite resources, you increase your chances of running into the dreaded “Post-Processing of the Image Failed” problem.

5. Tweak your PHP settings to increase the maximum execution time and maximum input time.

You can either change these settings in your php.ini file or fix them in cPanel. With Sanctus’ standard hosting plan, you can log into your cPanel and select the Select PHP Version under the Software pane:

This is what the PHP Selector option in cPanel will look like.

Once you enter the PHP selector, select a version of PHP that is either the same version as the native version (e.g. 7.2 at the time of this tutorial post) or an updated version. You’ll need to select something other than the “native (x.x)” option because with the native version option, you won’t be able to enter in custom settings via the Options tab, which we’re going to get to next.

Make sure you don’t select an option that reads “native (x.x)”

So once you’ve selected a version that is not the native version, you’ll want to go to the Options tab:

You’ll start out in the Extensions tab, you’ll want to switch to the Options tab

From here, we’ll want to change the following settings and set them to the maximum possible values:

max_execution_time 360
max_input_time 240

Like so:

Maximize these values to give the server more time to complete tasks such as post-processing large images.

Final Considerations

If you’re uploading very large image files and need more server resources, consider switching to a higher-end hosting platform with more server resources. This is the real reason why the “Post-Processing of the Image Failed” error occurs in the first place.

Standard hosting services are meant for small deployments for professional presences, small businesses, or simpler corporate websites.

Better hosting services can allow you to evade the “Post-processing of the image failed” error entirely. Sanctus can help you with that!

Technical Reading

Here’s a link to the issue being discussed among the WordPress core developers from approximately 7-8 months ago.

You can see the developers are discussing how WordPress is identifying a specific HTTP 500 Internal Server Error and trying to return more user-friendly information to the end-user, notably the would-be WordPress designer.

The developers came to the conclusion that instead of returning a simple “HTTP Error” as was done in previous versions of WordPress, this new “Post-processing of the image failed” error message would be much more descriptive and helpful.

And here is the support thread from which the original solution we enumerated was drawn from, the “GD Editor” fix.

Conclusion

And there you have it! That is the real reason why the “Post-processing of the image failed” error message is occurring and the various steps you can take to fix the issue. Our recommendation is that you compress your images before uploading the.

If you require very large image files to be linked, you can upload them separately into your website via FTP or another method and link smaller thumbnails that you’ve uploaded in WordPress to the URL where those larger images reside.

Or, alternatively, go for a more robust hosting platform such as our Premium Business Hosting plans which includes greater server resources. This way you can create robust websites without having to deal with the “Post-processing of the image failed” or other errors of the same nature again.

Did this article help you with your problem?

Did this article help you solve your problem? Let us know your feedback by reaching out to us via our contact form. If you found that this didn’t solve your problem or you found a better method, we’d be grateful if you could let us know and we will update this article.

Thank you for reading!

Share this post:
Share on facebook
Facebook
Share on linkedin
LinkedIn
Share on twitter
Twitter
Share on telegram
Telegram
Share on whatsapp
WhatsApp
Share on email
Email

Latest From Sanctus: