$upload_file = my.".".$file_ext;
$upload_path=$dir."/".$upload_file; //定义文件最终的存储路径和名称
if(is_uploaded_file($upload_tmp_file) )
{
if(move_uploaded_file($upload_tmp_file,$upload_path)){
list($width_orig, $height_orig) = getimagesize($upload_path);
if ($width_orig>61||$height_orig>61) {
$image_p = imagecreatetruecolor(61, 61);
if($piece[1]=="jpg"||$piece[1]=="jpeg"){
$image = imagecreatefromjpeg($upload_path);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, 61, 61, $width_orig, $height_orig);
imagejpeg($image_p,$upload_path);
}else if($piece[1]=="gif"){
$image = imagecreatefromgif($upload_path);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, 61, 61, $width_orig, $height_orig);
imagegif($image_p,$upload_path);
$upload_path=$dir."/".$upload_file; //定义文件最终的存储路径和名称
if(is_uploaded_file($upload_tmp_file) )
{
if(move_uploaded_file($upload_tmp_file,$upload_path)){
list($width_orig, $height_orig) = getimagesize($upload_path);
if ($width_orig>61||$height_orig>61) {
$image_p = imagecreatetruecolor(61, 61);
if($piece[1]=="jpg"||$piece[1]=="jpeg"){
$image = imagecreatefromjpeg($upload_path);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, 61, 61, $width_orig, $height_orig);
imagejpeg($image_p,$upload_path);
}else if($piece[1]=="gif"){
$image = imagecreatefromgif($upload_path);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, 61, 61, $width_orig, $height_orig);
imagegif($image_p,$upload_path);