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
include('class.upload.php'); $foo = new Upload($_FILES['afb1']); if ($foo->uploaded) { // save uploaded image with a new name, // resized to 100px wide $foo->file_new_name_body = 'image_resized'; $foo->image_resize = true; $foo->image_x = 450; $foo->image_y = 600; $foo->image_ratio = true; $foo->Process('/var/www/nl/domain/www/images/'); if ($foo->processed) { echo 'image resized'; $foo->Clean(); } else { echo 'error : ' . $foo->error; } }
My upload.php:
The script works perfectly with landscape images. I really hope you can help me with this. I really like this script!