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 = new upload("../temp_photos/mytest.jpg"); $handle->file_max_size='10240000'; if ($handle->uploaded) { $handle->image_crop = array(10,30,60,20); $handle->process("../temp_photos/"); if ($handle->processed) { echo 'image cropped'; $handle->clean(); } else { echo 'error : ' . $handle->error; } }