解决透明GIF图片形成缩略图背景黑色问题

Alu
Alu 这家伙很懒,还没有设置简介

2 人点赞了该文章 · 3512 浏览

如果你上传的是透明的GIF图片产生的缩略图背景是黑色的,特别难看,以下是解决方法: 找到 system\core\image.php
		if ($this->image_ext == 'png') {
			imagealphablending($dst_img, false);
			imagesavealpha($dst_img, true);
		}
		
	增加
	
		if ($this->image_ext == 'gif') {
			$color = imagecolorAllocate($dst_img, 255, 255, 255);
			imagefill($dst_img, 0, 0, $color);
		}
 

发布于 2016-09-19 09:29

免责声明:

本文由 Alu 原创发布于 WeCenter ,著作权归作者所有。

登录一下,更多精彩内容等你发现,贡献精彩回答,参与评论互动

登录! 还没有账号?去注册

net
2016-09-20 10:35
6666666666
kenw2004
2016-09-19 13:44
感谢大牛分享!
roger
2016-09-19 10:16
感谢技术大牛的分享