php利用gd库生成缩略图。
$h){
$width=300;
$height=$width/$w*$h;
}else if($w<$h){
$height=300;
$width=$height/$h*$w;
}else{
$width=300;
$height=300;
}
//创建空白新图片
$newimage=imagecreatetruecolor($width, $height);
//copy源图片内容 copy新图片
imagecopyresized($newimage, $image, 0,0, 0,0, $width, $height, $w, $h);
$filename="upload/s_".$file;
imagejpeg($newimage,$filename);以上就是php利用GD库生成缩略图示例_MySQL的内容,更多相关内容请关注PHP中文网(www.php.cn)!











