image_lib 处理GIF图像略缩图背景变成了黑色?WHY?..
同一图片放到新浪微博上正常,用image_lib生成了黑色背景的图像......UP......可惜现在没有空~ 帮顶,我也遇到过 $dst_img = $create($this->width, $this->height);
//ryan add 20110727 10:17处理透明背景图问题
$transparent = imagecolortransparent($src_img, imagecolorallocate($src_img, 0, 0, 0));
if ($transparent >= 0) {
imagecolortransparent($dst_img, $transparent);
imagealphablending($dst_img, false);//取消混杂模式
imagesavealpha($dst_img, true); //保留原有通道
}
//处理透明背景结束
$copy($dst_img, $src_img, 0, 0, $this->x_axis, $this->y_axis, $this->width, $this->height, $this->orig_width, $this->orig_height);
该方法处理后,图像周边会有个黑线,还在找办法处理 THANKS有空试试看
页:
[1]