Media Upload hangs on Crunching on too big image sizes. — at Version 2
|Reported by:||clubdesign||Owned by:|
Description (last modified by SergeyBiryukov)
If the uploaded file is too big for the Max Memory Limit Setting, then the upload is executed, but the image isnt resized to the set image sizes and the frontend gets stuck on "Crunching". I tracked the error down into the core and found out, that the main problem is in the GD library class ( wp-includes/class-wp-image-editor-gd.php ) in the load() function.
Everything works fine before line 91:
$this->image = @imagecreatefromstring( file_get_contents( $this->file ) );
So imagecreatefromstring fails because of a lack of memory. But as a chain reaction everything else fails afterwards. The library is not loaded and sent back, and so on. As a result no id is sent back to the frontend and the Loader hangs.
Maybe there should be any error catching and sending back before this GD function, that the frontend receives any error messages and that the upload is deleted in case of error.
Just my thoughts: As this error is a Fatal one, you can`t use any Exception stuff, cause there will not be any memory left to execute it. Maybe some checking if the id is present before sending the image back to crunching?