So if you try and manipulate an images which is too big you get the following:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 19008 bytes) in /Library/WebServer/Documents/test/sites/all/modules/imageapi/imageapi_gd.module on line 123
Is there a check we can do before opening the image to know if it's going to request too much memory and exit with a nicer drupal error message?
Comments
Comment #1
pescetti commentedsubscribing
Comment #2
hm2k commentedI have a solution which I would be willing to release which will help avoid these fatal errors.
I am accepting donations to fix this: http://tinyurl.com/hm2kpaypal
Repository: http://hm2k.googlecode.com/svn/trunk/code/php/functions/
Comment #3
hm2k commentedThe function is here: http://hm2k.googlecode.com/svn/trunk/code/php/functions/image_memory_che...
The function helps catch and avoid errors such as this when processing images:
Fatal error: Out of memory (allocated xxxxxxxx) (tried to allocate xxxx bytes) in /home/xxx/public_html/sites/all/modules/imageapi/imageapi_gd.module on line 59This is a bug because it's not acceptable for a module to expose a fatal error.