jxyuhua
新手上路

UID 71899
精华
0
积分 45
帖子 49
金钱 45 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2006-4-18
状态 离线
|
[广告]: Enom域名自助付费 自助注册 自助PUSH 主流域名COM等一律57.99元年
PHP GD输出字符的问题
在本地测试成功了,但到服务器上就没有结果,怀疑是环境的问题,但不知道如何解决。
我要在图片上写几个字,用的是imagettftext函数,下面是我的代码:
<?php $fnt = DIR_FS_CATALOG . "images/ADISPORT.TTF"; $ar = imagettfbbox($size, $angle, $fnt, $str); $width = $ar[2]; $height= max($size,$ar[1]-$ar[5]); $im = imagecreatefromjpeg($imagepath . $imagename); $white = imagecolorallocate($im, 255,255,255); $color = imagecolorallocate($im, 255,0,0); $color = imagecolorclosestalpha($im,222,140,33,10-$i*10); imagettftext($im, $size, $angle, 70-$ar[6], $height-$ar[1]+150, $color, $fnt, $str); imagejpeg($im); imagedestroy($im); ?> 下面是服务器的设置:
gd
GD Support enabled
GD Version bundled (2.0.23 compatible)
FreeType Support enabled
FreeType Linkage with TTF library
FreeType Version 1.3
GIF Read Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
我本地电脑的环境:
gd
GD Support enabled
GD Version bundled (2.0.28 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.9
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
为什么服务器上无效呢?直接输出原图了。怪事。
|  Books, Music,Video,Software,Electronics
http://www.civilianshop.com |
|