Over 1 Meg blank page

See all posts Reply

Over 1 Meg blank page new!
by Jon, 17 years, 10 months ago
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
Re: Over 1 Meg blank page new!
by colin, 17 years, 10 months ago
When you upload the picture, do you do any processing on the picture? Or do you upload it just as any file?

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 = 64MReply
Re: Over 1 Meg blank page new!
by Jon, 17 years, 10 months ago
Hi Colin, thanks for your reply, appreciated.

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.

Kind regards
JonReply
Re: Over 1 Meg blank page new!
by colin, 17 years, 10 months ago
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
Re: Over 1 Meg blank page new!
by Marcelo, 14 years, 8 months ago
Colin, I'm with that problem, apparentenly, how do I solve (I'm using Apache)?Reply
Re: Over 1 Meg blank page new!
by colin, 14 years, 8 months ago
See the first item on the FAQReply
Re: Over 1 Meg blank page new!
by Jon, 17 years, 10 months ago
Forgot to add......

Script works fine with images of around 1200px wide and less than 1 meg.Reply
Re: Over 1 Meg blank page new!
by colin, 17 years, 10 months ago
These 1200px probably represent the maximum dimension of your picture if you want to resize it with the amount of memory that you have available.Reply
Re: Over 1 Meg blank page new!
by Jon, 17 years, 10 months ago
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
source is an uploaded file
- source variables  
  file_src_name         :
  file_src_name_body    :
  file_src_name_ext     :     
  file_src_pathname     :     
  file_src_mime         :     
  file_src_size         :  (max= 75497472)    
  file_src_error        : 4
Reply
Re: Over 1 Meg blank page new!
by colin, 17 years, 10 months ago
If the upload works fine, these variables can't be empty. Make sure you are printing out the right logs, for the right call to process()Reply
Re: Over 1 Meg blank page new!
by Jon, 17 years, 10 months ago
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!

Kind regards
JonReply
Re: Over 1 Meg blank page new!
by colin, 17 years, 10 months ago
Drop shadows? You mean reflections, right? ;)

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!Reply
Re: Over 1 Meg blank page new!
by Justin Bird, 17 years, 7 months ago
sweet. that solved my problem, too.Reply
Re: Over 1 Meg blank page new!
by colin, 17 years, 7 months ago
Cool!

And thank you for your donation.Reply