vink 发表于 2011-7-18 10:34:36

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

同一图片放到新浪微博上正常,用image_lib生成了黑色背景的图像......

vink 发表于 2011-7-18 16:50:05

UP......可惜现在没有空~

zhouli520 发表于 2011-7-19 11:36:12

帮顶,我也遇到过

Ryan 发表于 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);

该方法处理后,图像周边会有个黑线,还在找办法处理

vink 发表于 2011-7-29 08:57:22

THANKS有空试试看
页: [1]
查看完整版本: image_lib 处理GIF图像略缩图背景变成了黑色?WHY?..