I am using WordPress 3.7.1, and was trying to upload photos using the multi-file uploader. Each time I got the dreaded ""An error occurred in the upload. Please try again later" error.
Going to the Library, I could see the photos listed, but without thumbnails. Clicking "Edit" showed the image. Clicking the "Edit image" button would cause WP to say "Image data does not exist. Please re-upload the image."
I scoured the web and tried all the suggestions I could find:
Deactivated all plugins.
Switched from my child theme to one of the default themes.
Tried uploading from the dashboard instead of from within a post editor.
Tried various browsers.
Nothing fixed it.
The images I was uploading were aroung 7mb, and the uploader mentioned there was a file size limit of 8mb. So I decided to try shrinking the images to see if it was a memory issue.
I started with a panorama which I shrank to 3600x1153 (1.6 mb). It didn't work. So I shrank it again to 3000x961 (1.1mb) and it worked!
But I wanted to see if I could upload at a higher resolution but with a smaller file size. So I took the same panorama, shrank it to 3600x1153 but saved it at a lower quality level, so the file size was 934kb. It didn't work!
Weird. So it seemed the problem wasn't absolute file size, but resolution -- or possibly total pixel count (3000x961 had worked, which was a total of 2,883,000 pixels).
To confirm this, I tried a different photo. I started with it at its original size (4608x456) and gradually reduced it in resolution, uploading each successive version. They all failed the same way with "An error occurred in the upload. Please try again later" (or the eternal "Crunching" hang, if using the dashboard uploader) until I got to 2000x1500 resolution.
At 2000x1500 (total pixel count: 3,000,000), it looked like it might work. It really crunched and was about to update the thumbnail when instead it displayed this message: "Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 4096 bytes) in /(censored)/blog/wp-includes/media.php on line 1288"
Weird. The issue persisted as I stepped down from 2000 to 1900 to 1850 pixels wide.
But at 1800x1350 resolution it worked! This is a total pixel count of 2,430,000, which is obviously lower than the other one that worked for me.
Can anyone explain this? What is it about this resolution that allows WP to work?