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.
You can do this indirectly: you can read image_src_x and image_src_y before calling process(), and act accordingly. For instance (not tested):
// the size you want
$my_x = 100;
$my_y = 100;
// the margins you will have to crop
$crop_x = (int) (($handle->image_src_x - $my_x) / 2);
$crop_y = (int) (($handle->image_src_y - $my_y) / 2);
// we set the cropping values
$handle->image_crop = array($crop_y, $crop_x, $crop_y, $crop_x);
// and call process()
$handle->process(...);