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 am having problems resizing images. I am using WAMP 5, with PHP ver 5.2.5 and have enabled gd support.
GD Support enabled GD Version bundled (2.0.34 compatible) FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.1.9 T1Lib Support enabled GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled XBM Support enabled
My form is as follows and calls the image_uploader.php script: <form enctype="multipart/form-data" action="image_uploader.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="8000000" /> File: <input name="uploadedfile" type="file" size="50"/><br /> <input type="submit" value="Upload File" /> </form>
When I remove the $handle->image_resize = true; line from the above code the image file is uploaded to the destination directory above with the original dimensions. However, when image_resize is set to true as above, the image file is not uploaded at all.
This may sound like a silly question, but where can I find the log from the class?
I did check the php_error.log and there are no entries in it.
The apache access.log has the following entries: 127.0.0.1 - - [24/Mar/2008:20:35:40 +0200] "GET /sam.css HTTP/1.1" 200 2836 127.0.0.1 - - [24/Mar/2008:20:35:48 +0200] "GET /upload_images.php?web_ref=300129883 HTTP/1.1" 200 798 127.0.0.1 - - [24/Mar/2008:20:35:54 +0200] "POST /image_uploader.php HTTP/1.1" 200 138
When I execute the code above, I don't get any error message, but just see a blank screen. I have tried with smaller images as well, but have the same problem.
Thank you so much for your advice, I made the following changes to my php.ini file: upload_max_filesize = 64M memory_limit = 64M post_max_size = 64M
After restarting PHP and the trying to upload and resize images, it worked perfectly- with dimensions as high as 2816x2112. It definitely appeared to be that an insufficient memory limit was enabled in PHP.
Thanks once again for your help.
Congrats and thanks for this brilliant Class- it is definitely the best file/image uploading and resizing class that I have worked with and really easy to use.Reply
I am having problems resizing images. I am using WAMP 5, with PHP ver 5.2.5 and have enabled gd support.
GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.9
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
My form is as follows and calls the image_uploader.php script:
<form enctype="multipart/form-data" action="image_uploader.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="8000000" />
File: <input name="uploadedfile" type="file" size="50"/><br />
<input type="submit" value="Upload File" />
</form>
image_uploader.php script:
When I remove the $handle->image_resize = true; line from the above code the image file is uploaded to the destination directory above with the original dimensions. However, when image_resize is set to true as above, the image file is not uploaded at all.
Any ideas...? Thanks very much
How big is the image you are trying to resize? Does it work with smaller pictures?
Can you paste here the log from the class when resizing fails?
This may sound like a silly question, but where can I find the log from the class?
I did check the php_error.log and there are no entries in it.
The apache access.log has the following entries:
127.0.0.1 - - [24/Mar/2008:20:35:40 +0200] "GET /sam.css HTTP/1.1" 200 2836
127.0.0.1 - - [24/Mar/2008:20:35:48 +0200] "GET /upload_images.php?web_ref=300129883 HTTP/1.1" 200 798
127.0.0.1 - - [24/Mar/2008:20:35:54 +0200] "POST /image_uploader.php HTTP/1.1" 200 138
When I execute the code above, I don't get any error message, but just see a blank screen. I have tried with smaller images as well, but have the same problem.
Thanks
As for the Apache logs, look into error.log
This said, it looks like a memory error to me, or maybe a defective GD.
Thank you so much for your advice, I made the following changes to my php.ini file:
upload_max_filesize = 64M
memory_limit = 64M
post_max_size = 64M
After restarting PHP and the trying to upload and resize images, it worked perfectly- with dimensions as high as 2816x2112. It definitely appeared to be that an insufficient memory limit was enabled in PHP.
Thanks once again for your help.
Congrats and thanks for this brilliant Class- it is definitely the best file/image uploading and resizing class that I have worked with and really easy to use.