deansatch Posted January 21, 2012 Share Posted January 21, 2012 In the past, whenever I write an image upload script in php that needs to generate a thumbnail or resized version, I have had to make sure the image is a reasonable size before uploading otherwise you get the old 'allowed memory bytes exceeded' thing. What are my options if I want people to be able to upload a full size image from their camera i.e. a 15-20mb 4000x3000px image and then have a thumbnail and something like 500px wide version for displaying on the site? The large unaltered original needs to be stored as well as it will be used for prints. Is this just not possible with PHP? Or is it down to needing a dedicated server? Quote Link to comment https://forums.phpfreaks.com/topic/255481-upload-large-images-and-manipulate/ Share on other sites More sharing options...
AyKay47 Posted January 21, 2012 Share Posted January 21, 2012 well, i have never known of an image3000 x 4000px being 20MB, but i could be wrong. anyway, their are a few php.ini directives that will need to be changed from their default values to be able to upload a file of that size. post_max_size upload_max_filesize memory_limit (should never really need to change this one, if your code is written correctly and optimized) Quote Link to comment https://forums.phpfreaks.com/topic/255481-upload-large-images-and-manipulate/#findComment-1309861 Share on other sites More sharing options...
deansatch Posted January 22, 2012 Author Share Posted January 22, 2012 Photos can be large files straight from a pro 21mp camera. But the filesize isn't really that much of an issue, it's more to do with the processing. I.e. Uploading the image should work fine...but during the upload if my script runs imagecopyresampled a couple of times to create the 2 smaller images and then sticks a watermark on top, the script will fail. It's just too much going on. So I suppose, back to my original question, what is the "proper" way to write it? Clearly it isn't the way I described above but I can't see another way?!?? Some sort of break sequence somehow? Where it runs each part separately at timed intervals? Quote Link to comment https://forums.phpfreaks.com/topic/255481-upload-large-images-and-manipulate/#findComment-1309992 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.