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.
more info about the class
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= 20971520) file_src_error : 2
It works fine with files under 1 Mb. What is file_src_error 2? If I resize the image to be less than 1 Mb raw file size, it works ok.