Hello,
I have a PHP/MySQL-based site with a considerable number of photos and videos that can be uploaded by members. When an image is uploaded to my site, it gets resized 3 times using the GD library, to create a thumbnail, a postcard, and a desktop-sized version. I've been having sporadic problems with a fatal error resulting from the memory_limit of 36 megs. The images that cause the error are always high-resolution images. I know WHY the error is occurring - the image dimensions are too large and thus consuming too much RAM. Example: a 1600x1200 image with a bit depth of 24 requires almost 47 megs of RAM for resizing (1600x1200x24 = 46,080,000)
I've taken steps to address this, including:
ini_set('memory_limit', '64M')
This should theoretically up the RAM to 64megs to accomodate the 1600x1200 image I mentioned. But it's not working. Even though phpinfo() shows the memory is set at 64megs, it still doesn't work. The file transfer to the server works fine, though!
So...
1) does ini_set('memory_limit', 'xxM') actually work, or are we blocked from changing memory limits?
2) are we generally prohibited from changing system settings such as this?
Any suggestions as to how I might accomodate high-resolution images besides just throwing back an error at the user telling them to manually resize first?