图片上传质量会变得很差
<input type="file" size="30" name="upload_image" id="team-create-image" class="f-input" />function upload_image($inputname, $image=null, $type='team', $width=440) {
$year = date('Y'); $day = date('md'); $n = time().rand(1000,9999).'.jpg';
$z = $_FILES[$inputname];
if ($z && strpos($z['type'], 'image')===0 && $z['error']==0) {
if (!$image) {
RecursiveMkdir( IMG_ROOT . '/' . "{$type}/{$year}/{$day}" );
$image = "{$type}/{$year}/{$day}/{$n}";
$path = IMG_ROOT . '/' . $image;
} else {
RecursiveMkdir( dirname(IMG_ROOT .'/' .$image) );
$path = IMG_ROOT . '/' .$image;
}
if ($type=='user') {
Image::Convert($z['tmp_name'], $path, 48, 48, Image::MODE_CUT);
}
else if($type=='team') {
Image::Convert($z['tmp_name'], $path, $width,0,Image::MODE_SCALE);
}
return $image;
}
return $image;
}
上传图片的时候 图片质量会变得非常的差 这个要怎么修改?