header('Content-type imagejpeg');jpg类型 list($width, $height, $type, $attr) = getimagesize($filename); 获取图片信息 $picx=($width-$height)2; $picy=($height-$width)2; 截取图片正中间 if($width$height){$tempsize=$height; $picy=0; $newpicsizeheight=$height; }elseif($width$height){$tempsize=$width; $picx=0; $newpicsiz