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 trying to resize and crop images class.upload.php and it's working fine with small images (say, 20k or 30k) but it's not letting me upload larger images, even on my localhost. I've tried setting file_max_size and the ini mem limit to 20M but to no avail.Reply
20MB is not a lot at all if you want to process images. Also, the size of the image is not important; only the dimensions in pixels are relevant, as the image is uncompressed as bitmap in memory.
It's not returning any errors unfortunately; I've tried debugging it but to no avail. Even if I don't crop the larger images, if I just refer to them as images (i.e. if I instantiate image_resize=true) it also crashes. It seems like the script just doesn't like the larger images - they're all RGB Jpeg's. *confused*Reply
It is almost certainly a memory issue. Check with a phpinfo() that you indeed have raised the memory limits. Also try, just for the sake of testing, to have a lot of memory available (100+MB, rather than 20 or 32).Reply
I have the same problem, I work with local files, I uploaded with a perl cgi that I wrote, because my server is so limited in time limit, then when I process a small image, works really fine, but when I process 1MB > crash... don't tell anything, any error, simply when execute $handle->Process('../img/Thumbs1/'); don't continue... break...
So with this picture, just to load it in memory, you a reaching your memory limit. Your application probably use some memory too, and if you do processing on the image, you need more memory.Reply
How can I check this? My GD info is: GD Support enabled GD Version bundled (2.0.34 compatible) FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.2.1 GIF Read Support enabled GIF Create Support enabled JPEG Support enabled libJPEG Version 6b PNG Support enabled libPNG Version 1.2.10 WBMP Support enabled XPM Support enabled XBM Support enabled
and the mega pixcel i think it calculated by multiplying px width with px height, 3264x2448 = 7990272 ( 7 mega pixcel ? )Reply
What are the errors that you get?
It is almost certainly a memory issue. Check with a phpinfo() that you indeed have raised the memory limits. Also try, just for the sake of testing, to have a lot of memory available (100+MB, rather than 20 or 32).
I have the same problem, I work with local files, I uploaded with a perl cgi that I wrote, because my server is so limited in time limit, then when I process a small image, works really fine, but when I process 1MB > crash... don't tell anything, any error, simply when execute $handle->Process('../img/Thumbs1/'); don't continue... break...
Can you help me... my code is:
please I need it...
Regards
Bruno Chávez
Try to raise your local memory to 20M, 32M or more.
You can add this in your script:
Or in a .htaccess file:
8M * 8 bits = 64Mbytes
So with this picture, just to load it in memory, you a reaching your memory limit. Your application probably use some memory too, and if you do processing on the image, you need more memory.
If your GD Library support this then it must resize image.
My GD info is:
GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.2.1
GIF Read Support enabled
GIF Create Support enabled
JPEG Support enabled
libJPEG Version 6b
PNG Support enabled
libPNG Version 1.2.10
WBMP Support enabled
XPM Support enabled
XBM Support enabled
and the mega pixcel i think it calculated by multiplying px width with px height,
3264x2448 = 7990272 ( 7 mega pixcel ? )