杭州神话信息技术有限公司
标题:
修正V3.0.0beta Build20110916签名档头像被剪裁的方法
[打印本页]
作者:
wxyl
时间:
2011-9-17 10:45:37
标题:
修正V3.0.0beta Build20110916签名档头像被剪裁的方法
本帖最后由 wxyl 于 2011-9-17 11:02 编辑
试用了下V3.0Beta,发现签名档有问题,如下图所示:
[attach]2921[/attach]
主要是头像被剪裁了,查看了下签名档的代码,修改了下,看效果:
[attach]2920[/attach]
修改方法:
打开文件:
include\logic\other.logic.php
找到:
$new_face_height=$height*$percent;
复制代码
在下面添加:
$thumb = imagecreatetruecolor($new_face_width,$new_face_height);
imagecopyresampled($thumb,$user_src_im,0,0,0,0,$new_face_width,$new_face_height,$width,$height);
复制代码
找到:
imagecopyresampled($user_src_im,$box,0,0,0,0,$new_face_width,$new_face_height,80,80);
复制代码
修改为:
imagecopyresampled($thumb,$box,0,0,0,0,$new_face_width,$new_face_height,80,80);
复制代码
找到:
imagecopymerge($bg,$user_src_im,$dst_x,$dst_y,$src_x,$src_y,$new_face_width,$new_face_height,$alpha);
复制代码
修改为:
imagecopymerge($bg,$thumb,$dst_x,$dst_y,$src_x,$src_y,$new_face_width,$new_face_height,$alpha);
复制代码
附上修改过的文件(包含GBK和UTF-8):
[attach]2922[/attach]
作者:
hhren1984
时间:
2011-9-17 11:04:04
多谢,还有一个问题兄台能解决否
头像是gif图片,而且边框文字出现貌似乱码问题
[attach]2923[/attach]
作者:
yachtxiao
时间:
2011-9-17 22:15:18
hhren1984 发表于 2011-9-17 11:04
多谢,还有一个问题兄台能解决否
头像是gif图片,而且边框文字出现貌似乱码问题
这个问题应该是做的字符截取函数截取出错导致出现乱码,我自己做的V2.6.6的签名档程序就完美地解决了这个问题,字符截取函数是网上找来的,同志们可以自己去网上搜搜中英文符号混合截取函数。
作者:
lnbp
时间:
2011-9-18 07:34:50
困扰了一晚上!楼主好人呀!
作者:
wqjtop
时间:
2011-10-17 00:04:23
不错,为什么不能像官方那样,上传头像呢?
欢迎光临 杭州神话信息技术有限公司 (http://cenwor.com/)
Powered by Discuz! X2