用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2857|回复: 4
收起左侧

[HELP] image_lib 处理GIF图像略缩图背景变成了黑色?WHY?..

[复制链接]
发表于 2011-7-18 10:34:36 | 显示全部楼层 |阅读模式
同一图片放到新浪微博上正常,用image_lib生成了黑色背景的图像......

略缩图

略缩图

原图像

原图像
 楼主| 发表于 2011-7-18 16:50:05 | 显示全部楼层
UP......可惜现在没有空~
发表于 2011-7-19 11:36:12 | 显示全部楼层
帮顶,我也遇到过
发表于 2011-7-27 10:23:02 | 显示全部楼层
$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);

该方法处理后,图像周边会有个黑线,还在找办法处理
 楼主| 发表于 2011-7-29 08:57:22 | 显示全部楼层
THANKS  有空试试看

本版积分规则