Discuz修复PNG透明图片生成缩略图时背景变黑的BUG
解决手机版png透明图片黑底问题打开 source\class\class_image.php
找到这个函数(所有修改都在这个函数内)
function Thumb_GD() {下边找到$copy_photo = imagecreatetruecolor($this->imginfo['width'], $this->imginfo['height']);imagecopy($copy_photo, $attach_photo , 0, 0, 0, 0, $this->imginfo['width'], $this->imginfo['height']);$attach_photo = $copy_photo;改为
if($this->imginfo['mime'] != 'image/png') { $copy_photo = imagecreatetruecolor($this->imginfo['width'], $this->imginfo['height']); imagecopy($copy_photo, $attach_photo , 0, 0, 0, 0, $this->imginfo['width'], $this->imginfo['height']); $attach_photo = $copy_photo;}找到(三处)$thumb_photo = imagecreatetruecolor下边添加if($this->imginfo['mime'] == 'image/png') { imagealphablending($thumb_photo, false); imagesavealpha($thumb_photo, true);} dz论坛 png缩略图优化教程
页:
[1]