class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
I'm using the last version and I always get a blank page after:
$handle = new Upload($_FILES['image_field']);"
Anything I echo before it will be printed with no problem whatsoever, but it just tilt after this line. Not even try/catch stop it from happening. I even checked for memory limit, it's 100M and my folder permissions are 777.
Just done some more checking. If I run Process without any file or image changes, i.e. a straight file upload it works fine in IE8, but as soon as I add anything bofore the process say something like :
Thanks for the suggestion. But, I have tried this but it doesn't work. I used the following, which I use on the same server account for other file processing:
I even have access to the php.ini via cpanel and it is currently set as 256M memory limit, so even if my ini_set calls are not working it should be fine.
However, I tried the exact same image on FF and it doesn't work. so it's the image that's the problem. it's a .jpg, file size is about the same as the one that works, but the pixel size is very different.
As I said, you are very likely running out of memory.
Your destination image is 1600x1600. This requires at least 1600*1600*8 which is about 20MB. Assuming your source image is 2000x2000, you will have to add at least 30MB. It is already 50MB just for the images to be in memory. To this, you add the memory required by your project, etc...
An easy test to see whether it is memory or not: change your destination sizes to 160x160, and try to upload an approx 200x200 pixels image. If this one uploads and resizes properly, but the larger images don't, then it is a memory issue.Reply
Check you webserver logs, it will tell you why the page crashes.
If you need to upload very large images, you'd better off using ImageMagick for instance; PHP/GD is not really appropriate for intensive processing.Reply
Anything I echo before it will be printed with no problem whatsoever, but it just tilt after this line. Not even try/catch stop it from happening.
I even checked for memory limit, it's 100M and my folder permissions are 777.
Here is the code:
I get same problem only in IE8. Code appears to stop at ->process. Works fine on FF and IE9
I can't find any reference to this issue for IE8.
Server error log shows nothing.
Dan
Just done some more checking. If I run Process without any file or image changes, i.e. a straight file upload it works fine in IE8, but as soon as I add anything bofore the process say something like :
It does not process and no error is given, just stops.
Wonder if this provides clues?
Dan
In fact, you are running out of memory. Search for memory in the site, or click here.
You can also check this post.
Also, tried uploading a php.ini file to the root. My host does allow this as I have used this before.
I have no problems with FF, IE9 and Safari 5
Thanks, Dan
You say it works on FF, IE9 but not IE8? With the exact same image? The browser shouldn't matter at all.
I even have access to the php.ini via cpanel and it is currently set as 256M memory limit, so even if my ini_set calls are not working it should be fine.
However, I tried the exact same image on FF and it doesn't work. so it's the image that's the problem. it's a .jpg, file size is about the same as the one that works, but the pixel size is very different.
The processing I am using is:
So wonder if this is causing the problem?
Thanks for your help here.
Cheers, Dan
Your destination image is 1600x1600. This requires at least 1600*1600*8 which is about 20MB. Assuming your source image is 2000x2000, you will have to add at least 30MB. It is already 50MB just for the images to be in memory. To this, you add the memory required by your project, etc...
An easy test to see whether it is memory or not: change your destination sizes to 160x160, and try to upload an approx 200x200 pixels image. If this one uploads and resizes properly, but the larger images don't, then it is a memory issue.
My source image is 4608 X 3072 and am processing it 4 times to 4 different sizes.
Even if I don't process the first time the remaining 3 don't work either.
Not really sure how to deal with this since images that will be uploaded by users are likely to be of large pixel size, i.e. from a digital camera.
Thanks, Dan
If you need to upload very large images, you'd better off using ImageMagick for instance; PHP/GD is not really appropriate for intensive processing.