Wordpress HTTP error when uploading a photo

I had a few cases when clients report an "HTTP error" during photo upload. Which looks similar to this:

In all these cases the problem was caused by the thumbnail generation Wordpress script.

First of all check you theme thumbnail sizes if you use a custom theme. Chances are that some of the "non-cropped" image sizes are too big to be generated in a reasonable time or memory limit (these resources may unexpectedly end WP thumbnail generation script which is a direct cause of "HTTP error"). The easiest way is installing Simple Image Sizes plugin and checking Settings > Media menu tab. Look for thumbnail sizes that are not cropped and/or has very large dimensions restrictions e.g. 1920 x 9999 non-cropped is a good candidate.

The reason is that if you upload narrow but tall image e.g 500x1500 this thumbnail size will have to generate enormously large photo.

The other possible reason for "HTTP error" is too many image thumbnails that are generated by Wordpress, so the script doesn't manage to generate all of them before it hits PHP timeout.

A third possible cause of "HTTP error" (probably most common) is your client uploading photos directly from a camera. This might be hard to solve as you generally don't want to tell your clients that image preprocessing is required before using them on the website (clients doesn't like to do anything more than drag and drop photos). Fortunately, there is Imsanity plugin which seems to be solving this issue. It resizes original images after file upload. Based on my recent experience with "HTTP error" I believe that this conversion takes place before thumbnails generation as installing Imsanity solves "HTTP error" caused by a large uploaded photo resolution.