require("../configs/smarty.php");
$img_file="../images/slide_img_b.jpg";
list($img_height,$img_width)=GetImageSize($img_file);
header("Content-type: image/jpeg");
$block_img=imagecreatetruecolor(150,150);
$color=imagecolorAllocate($block_img,255,0,0);
imagefill($block_img,0,0,$color);
$image=imagecreatefromjpeg($img_file);
imagecopyresampled($block_img,$image,0,0,0,0,150,150,$img_width,$img_height);
$show=imagejpeg($block_img,null,100);
$smarty->assign("show",show);这段代码产生的图片有个问题就是图片下面总是有60 70px的黑色区域这是为什么呢?imagecopyresampled($block_img,$image,0,0,0,0,150,220,$img_width,$img_height);改成220左右那个黑色区域就会被图片覆盖掉,但是我明明设置的150,150都是一致的为什么会出现这个多余的黑色区域呢?