Image resizing causes "out of memory" error |
Hey there, all...
I wrote a utility (w/CodeIgniter 3.0.5) for a client that allows him to upload photos, and they're resized for the web. The script has been working fine for several months, but all of a sudden he's getting out-of-memory errors, along the lines of this: Quote:FILE NAME: IMG_0047.JPG test The "resized" images aren't actually saved. I know the first choice solution is to allocate more memory with php_ini, but it appears that the hosting provider -- 1and1 . com -- doesn't allow that; it's set at a hard 120M; I'm guessing they don't want customers screwing with their shared servers. Any thoughts? Here's the code that handles the resizing: PHP Code: public function uploadapicture() {
03-26-2016, 02:44 PM
(This post was last modified: 03-26-2016, 02:47 PM by PaulD. Edit Reason: Cut out a bit because I misunderstood the question )
Hi,
If you are letting them upload images of 50MB, I am not at all surprised that you sometimes run out of memory with a 120MB limit (which is on the generous side IMHO for a shared hosting account). I would suggest either upgrading your hosting, reducing the image size limit, or checking your image manipulation code for performance issues. I am sure that was no real help at all, sorry, Paul.
And the image manipulation code is entirely within CodeIgniter -- not my code.
The image resizes stops after 35389440 bytes (35 MB), not at 120 MB. Perhaps you can debug the amount of memory used before the image manipulations is started? Or perhaps your hosting company lowered the amount of allowed memory from 120 MB to 35 MB.
|
Welcome Guest, Not a member yet? Register Sign In |