第一个,可以参考一下我以前写的函数:
function makethumb($image, $PhotoID) 
//this func. resize a JPEG image to a thumb and copy them to dirs.
//so useful ^_^ 2003 4 20 by DFlying
{
$data = @getimagesize($image, &$info);
if($data[2] == 2)
{
$photo = imagecreatefromjpeg($image);
copy($image, "../photos/photos/{$PhotoID}.jpg");
$W = imagesx($photo); //get width
$H = imagesy($photo); //get highth
if(($W/$H) > 1.35)//resize 
{
$newW = 135;
$newH = 135 * $H / $W; 
}
else
{
$newH = 100;
$newW = 100 * $W / $H;
}
$thumb = imagecreate($newW, $newH);
imagecopyresized($thumb, $photo, 0, 0, 0, 0, $newW, $newH, $W, $H);
imagejpeg($thumb, "../photos/thumbs/{$PhotoID}.jpg");
return 1;
}
return 0;
}第二个,FAQ里面好像有,等我找找…