//Create a new image
$new_f=imagecreatetruecolor($new_w, $new_h);
//Create an image with a resource image
$sour_f=imagecreatefromjpeg($source);
/ /Copy the resource image to a new image
imagecopyresampled($new_f, $sour_f, 0, 0, 0, 0, $new_w, $new_h, $s_w, $s_h);
//Output the image to the browser
imagejpeg($new_f,$newfile);
imagedestroy($new_f);
imagedestroy($sour_f);
}
}
?>