Processing large files

See all posts Reply

Processing large files new!
by Seanie, 17 years, 6 months ago
I???m having issues with processing multiple images; I am using the basic example script, with one exception. I have added this to the MULTIPLE UPLOADS part:
$handle->image_resize         = true;
$handle->image_ratio_y        = true;
$handle->image_x              = 200;

It works for small images, but for larger pictures (1.5mb each) it will only process one of the 3 photos.

I have changed my php.ini to have:
upload_max_filesize = 256M
post_max_size = 256M
memory_limit = 256M
max_execution_time = 0

The log ($handle->log )doesn???t show anything, the one thing I have learned is that the ???foreach??? loop dies on the second pass, when it gets to $handle->Process("./test/");

Is there some way to work around this problem?Reply
Re: Processing large files new!
by Tim, 17 years, 6 months ago
On a related note, is anyone else getting the annoyng timeout message when using Firefox? Is there a way, on the server side, to prevent Firefox from timing out? (The exact message is "A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete")Reply
Re: Processing large files new!
by colin, 17 years, 6 months ago
Tim, the message that you have in Firefox indicates that a client-side script is using too much resources, not a server-side script. If your upload scripts dies, or takes too long, you will have a simple Page not found message in Firefox.Reply
Re: Processing large files new!
by Tim, 17 years, 6 months ago
Well, all I know is that I can upload 1 MB file no problem. But with files that are much bigger, the upload process sometimes takes more than the standard Firefox timeout and causes the message, forcing the user to click Continue. I'm surprised nobody else is seeing this. I know I can change the Firefox settings on my machine, but that won't fix the problem for my users.

Maybe, out of curiosity, I'll check and see if some of the major photo sites cause the same problem during upload.Reply
Re: Processing large files new!
by colin, 17 years, 6 months ago
Please let me know if you discover anything on that matter. It is possible that Firefox displays the message when uploading the image, which I think is not the right behaviour, since the browser is actually working while uploading the image; it is not hanging.

In any case, there's not a lot that we can do here. Using PHP upload forces us to this restrictions, not to mention the maximum upload size limit. If you want to upload really big images, and avoid problems that you described, maybe a Java solution would be more adapted. After all, PHP has its limits... ;)Reply
Re: Processing large files new!
by colin, 17 years, 6 months ago
Seanie, I would have to do some more test, I am running out of time now. But I would say that the script runs out of memory, even thought you gave it 256MB.

I will be checking as soon as I can if the image objects are cleanly destroyed before each process.

Generally speaking, it is a bit heavy to do such big image manipulation in PHP/GD. Maybe using ImageMagick would be more adapted in your case.Reply
Re: Processing large files - SOLUTION! new!
by Mark Kiehl, 15 years, 5 months ago
These php.ini settings allowed me to upload a 1600x1200 766kb jpeg.

max_execution_time = 90 ; This was my primary constraint.
max_input_time = 90
memory_limit = 10M
post_max_size = 10M
file_uploads = On
upload_max_filesize = 4MReply