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.
Hi, When I try to upload an image over 1 Meg, it doesn't upload and all I get is a blank upload page. I have checked max file upload using phpinfo() and it is set at 8Meg.
I have added the MAX_FILE_SIZE to the form (as mentioned in another post), still no change.
Anything lower than 1 Meg works fine... Any help greatly appreciatedReply
Unfortunately i can't change the memory, i use a shared webspace.
After trying for hours, I am not sure it is a file size problem. I reduced one image to 600Kb but left the dimensions to 2272px wide......it gave same problem.
I am trying to upload images and yes using your script to first resize width to:
$handle->image_x = 1000;
and then creating thumb:
$handle->image_x = 200;
I echoed a statemement that proved it uploaded to the tmp folder but wouldn't echo this:
if ($handle->processed) {
echo" everything was fine !";
Is there anything you can think of? or a way around it? Would be very grateful.
It is actually a file size issue. It is also a file dimension issue.
The dimensions that you want (2272px wide) are too big for the memory you have available. What happens is that the class (GD actually) converts the image into a bitmap before resizing it, or compressing it. A bitmap will require a lot more room than the JPEG version of the same image.
So if you have a file with a great dimensions (a lot of pixels), and even though the file size is small (in KB), the class will require a lot of memory to process your image.
There is no way around but reduce the dimensions of your picture, or increase the memory limit on your host.Reply
Sorry also forgot to mention................. Don't know if relevent, but even when it all works fine, I get no info. Below is from an image i just uploaded successfully. It is typical
Thank you Colin. I will see if my web host will increase the memory to 64.
In the meantime I will reduce the file size to less than 1000px.
Very much appreciate your help and quick replies. I also want to say thanks for your script, it's fantastic and the thumbnail creation with dropshadow is great!
If you like the script, you can contribute by rating the class on the sites such as PHP Classes or HotScripts, writing a review on a blog or even donating my a little bit!Reply
I have added the MAX_FILE_SIZE to the form (as mentioned in another post), still no change.
Anything lower than 1 Meg works fine...
Any help greatly appreciated
If you do some image processing, such as resizing, a 1MB image will require quite a bit of memory for PHP.
I would say that you run out of memory. Try increase it in your php.ini: memory_limit = 64M
Unfortunately i can't change the memory, i use a shared webspace.
After trying for hours, I am not sure it is a file size problem. I reduced one image to 600Kb but left the dimensions to 2272px wide......it gave same problem.
I am trying to upload images and yes using your script to first resize width to:
and then creating thumb:
I echoed a statemement that proved it uploaded to the tmp folder but wouldn't echo this:
Is there anything you can think of? or a way around it? Would be very grateful.
Kind regards
Jon
The dimensions that you want (2272px wide) are too big for the memory you have available. What happens is that the class (GD actually) converts the image into a bitmap before resizing it, or compressing it. A bitmap will require a lot more room than the JPEG version of the same image.
So if you have a file with a great dimensions (a lot of pixels), and even though the file size is small (in KB), the class will require a lot of memory to process your image.
There is no way around but reduce the dimensions of your picture, or increase the memory limit on your host.
Script works fine with images of around 1200px wide and less than 1 meg.
Don't know if relevent, but even when it all works fine, I get no info. Below is from an image i just uploaded successfully. It is typical
In the meantime I will reduce the file size to less than 1000px.
Very much appreciate your help and quick replies. I also want to say thanks for your script, it's fantastic and the thumbnail creation with dropshadow is great!
Kind regards
Jon
I plan to implement drop shadows at some point.
If you like the script, you can contribute by rating the class on the sites such as PHP Classes or HotScripts, writing a review on a blog or even donating my a little bit!
And thank you for your donation.