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
$handle->image_resize = true; $handle->image_ratio_y = true; $handle->image_x = 84; $handle->image_border = '1px'; $handle->image_border_color = '#FFFFFF'; $handle->file_new_name_body = substr($_POST['current1'],0,-4); $handle->file_overwrite = true; $handle->Process($dir_dest); // we check if everything went OK if ($handle->processed) { $info = getimagesize($handle->file_dst_pathname); if ($info[1] > 70) $handle->image_crop = array(0,0,($info[1]-70),0); $handle->Process($dir_dest);