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.
Hey Colin - First off, thanks for putting together such a great script! The script seems to be working fine except for the resize function. Any ideas and help would be great. My code and log output is below:
The log says: - MIME type detected as regular file by UNIX file() command - file mime OK : regular file - no image processing wanted
That means that the UNIX file command returned regular file as a MIME type, which is not correct. And then the class doesn't think that the file is a valid image, and deactivate image processing. which is why the file is uploaded, but not resized.
Could you please send me the picture privately, and also indicate here which OS you are running the script on?
What do you get if you run in a shell:
file -bi your_image.jpg
You should get a MIME type here, but in your case you seem to get regular file.Reply
First off, thanks for putting together such a great script! The script seems to be working fine except for the resize function. Any ideas and help would be great. My code and log output is below:
The log:
system information
- GD version : 2.0.34
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- language : en_GB
source is an uploaded file
- upload OK
- file name OK
- MIME type detected as regular file by UNIX file() command
- source variables
file_src_name : test.png
file_src_name_body : test
file_src_name_ext : png
file_src_pathname : /private/var/tmp/phpKpWqw2
file_src_mime : regular file
file_src_size : 36021 (max= 2097152)
file_src_error : 0
process file to images/users/
- file size OK
- file mime OK : regular file
- new file name ext : jpg
- new file name body : member_image
- file name safe format
- destination variables
file_dst_path : images/users/
file_dst_name_body : member_image
file_dst_name_ext : jpg
- no image operation, keep extension
- checking for auto_rename
auto_rename to member_image_1.jpg
- destination file details
file_dst_name : member_image_1.jpg
file_dst_pathname : images/users/member_image_1.jpg
- member_image_1.jpg doesn't exist already
- no image processing wanted
- process OK
cleanup
- delete temp file /private/var/tmp/phpKpWqw2
- MIME type detected as regular file by UNIX file() command
- file mime OK : regular file
- no image processing wanted
That means that the UNIX file command returned regular file as a MIME type, which is not correct. And then the class doesn't think that the file is a valid image, and deactivate image processing. which is why the file is uploaded, but not resized.
Could you please send me the picture privately, and also indicate here which OS you are running the script on?
What do you get if you run in a shell:
You should get a MIME type here, but in your case you seem to get regular file.