timlondon Posted February 26, 2008 Share Posted February 26, 2008 I'm having problems using GD to resize large images (2mb +). Is GD the best way forward for this or should i be using something like Imagemagick? Quote Link to comment Share on other sites More sharing options...
Xeoncross Posted February 26, 2008 Share Posted February 26, 2008 As far as I know GD should be fine with that - however PHP it's self might be the cause of your problems. PHP is only allowed so much RAM per page request. You might need up to 6MB to process a 2MB image, and yet your PHP memory_limit could be set to only 4MB. http://us.php.net/manual/en/ini.core.php#ini.memory-limit Quote Link to comment Share on other sites More sharing options...
timlondon Posted February 26, 2008 Author Share Posted February 26, 2008 do you mean the ini files resource limits? They are set to: max_execution_tim = 30 max_input_time = 60 memory_limit = 32M Quote Link to comment Share on other sites More sharing options...
timlondon Posted February 27, 2008 Author Share Posted February 27, 2008 I've increased the memory_limit to 128 but the problems still there. I think i've isolated the problem to a copy failure. $newname="../../mbr/".$fl."/".$detail[0]."/Imagetmp/".$image_name; $copied = copy($_FILES['image']['tmp_name'], $newname); if (!$copied) { echo 'Copy failed!'; exit; } The above works fine when uploading images under 2mb. But any image over 2mb gets a coy failure. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.