Image Manipulation class dies on JPEGs larger than 1938x2911 |
[eluser]cairo140[/eluser]
I use the file upload class and image manipulation library. The manipulation function Code: $this->image_lib->resize() Code: $config['upload_path'] = './uplimg/avatars'; The resize function should return a true on success or false on failure, but if I upload a "bad" image, the server just 500s and does not show anything. I tried this on another server and cannot duplicate the results. I do not have a config file in application/config for either library. Help?
[eluser]Colin Williams[/eluser]
Quote:I tried this on another server and cannot duplicate the results Then I think you need to look at your server error logs and see what's up, or get a server administrator to help you out.q
[eluser]cairo140[/eluser]
Which error logs should I look for? It's running a regular LAMP. I can get to pretty much anything through SSH.
[eluser]Colin Williams[/eluser]
something like apache/logs/error.log. It's configurable with the ErrorLog directive, so it could exist anywhere.
[eluser]cairo140[/eluser]
I found something at /etc/httpd/logs/error_log but it didn't have any entries since Tuesday. There was also an access_log but it was just filled with internal dummy connections. I found access_log and error_log in Plesk specific to the domain. Searching for the specific connection in the access_log just yields my IP address then 500. The error_log has a number of errors but nothing at the time of my error.
[eluser]janogarcia[/eluser]
Hi cairo140, I had a similiar problem long ago. It was caused by the PHP memory_limit directive. A JPG image of about 2MB would eat up about 20MB of server memory when decompressed by the GD library. memory_limit was set to 16MB, so the script failed silently, no error displayed.
[eluser]cairo140[/eluser]
[quote author="janogarcia" date="1260542864"]Hi cairo140, I had a similiar problem long ago. It was caused by the PHP memory_limit directive. A JPG image of about 2MB would eat up about 20MB of server memory when decompressed by the GD library. memory_limit was set to 16MB, so the script failed silently, no error displayed.[/quote] Brilliant! Great idea that I didn't think of. Odd how this doesn't generate an error message. My memory limit was set as 32 MB actually, but it evidently still wasn't enough. I upped it to 64 MB and all works fine!
[eluser]janogarcia[/eluser]
Nice! Glad to be of help. Maybe I should suggest adding it as a warning note on the Image Library documentation (as CI's documentation doesn't allow user comments). |
Welcome Guest, Not a member yet? Register Sign In |