- UID
- 680231
- 积分
- 0
- 金币
- 18
- 精华
- 0
- 威望
- 0
- 贡献
- 0
- 阅读权限
- 220
- 注册时间
- 2010-6-11
- 最后登录
- 2026-5-3
- 在线时间
- 0 小时
热心网友
- 金币
- 18
- 阅读权限
- 220
- 精华
- 0
- 威望
- 0
- 贡献
- 0
- 在线时间
- 0 小时
- 注册时间
- 2010-6-11
|
解决手机版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);
- }
透明, 图片, class, 这个, 函数 |
|