打开 source\class\class_image.php
找到这个函数(所有修改都在这个函数内)
下边找到
- $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);
- }
复制代码