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.
Do not copy your object $foo. You have two sources images, so you can instantiate the class twice. For the first instance, you process two images. For the second instance, you process one image.
You should have something like this:
$foo = new Upload($_FILES['mhna_pic']);
$foo2 = new Upload($_FILES['mhna_pic2']);
if ($foo->uploaded && $foo2->uploaded) {
// save main image
$foo->Process('ups/');
$first = $foo->file_dst_name;
// make thumbnail
$foo->file_new_name_body="image_resized";
$foo->image_resize=true;
$foo->image_convert=gif;
$foo->image_x=90;
$foo->image_y=105;
$foo->Process('ups/');
$thumb = $foo->file_dst_name;
// save second image
$foo2->Process('ups/');
$second = $foo2->file_dst_name;
if ($foo->processed && $foo2->processed) {
// save your image names here: $first, $thumb, $second
}
}
You should have something like this: