Page 1 of 1
GD Issue
Posted: Sat Dec 15, 2007 6:37 pm
by Inkyskin
Hi all,
Does anyone know if there is a filesize limit that GD can work with?
I have a script that takes an uploaded image and then resizes to various different sizes - but it fails on images around 9mb and larger. The image is uploaded as I can see it on the server, it just isnt touched afterwards.
Thanks

Posted: Sat Dec 15, 2007 6:56 pm
by John Cartwright
PHP's default memory limit is 8mb. You can temporarily change this using ini_set() or .htaccess.
Posted: Sat Dec 15, 2007 10:24 pm
by RobertGonzalez
PHP also has a max_file_upload limit and a max_post_size limit as well. The file upload limit I believe is 2M while the max post size is 8M by default.
Posted: Sat Dec 15, 2007 10:31 pm
by Benjamin
For a 9mb image you'll want to allow about 128mb for the script. This is 9mb jpeg compressed image x 10 uncompressed while processing and leaving a little room for overhead.
Posted: Sun Dec 16, 2007 6:35 am
by Inkyskin
Thanks all - I have already increased the upload and post size, but the memory limit does need to be increased still.. I'll try that and let you know
Will increasing the memory limit to that much have an effect on the rest of the site at all? Will it slow it down etc?
Posted: Sun Dec 16, 2007 9:30 am
by John Cartwright
If you are using ini_set(), it will only affect the current script. If you want a more site-wide affect then your best bet is editing your php.ini, however if that is not an option you can use .htaccess