喜悦国际村 
» 游客:  注册 | 登录 | 搜索 | 统计 | 喜悦证交所 | 帮助

RSS 订阅当前论坛  

$5.95 Web Hosting     

上一主题 下一主题
     
标题: [问题] PHP GD输出字符的问题  
 
jxyuhua
新手上路
Rank: 1



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];
  
$heightmax($size,$ar[1]-$ar[5]);
  
$im    imagecreatefromjpeg($imagepath $imagename);
  
$white imagecolorallocate($im255,255,255);
  
$color imagecolorallocate($im255,0,0);
  
$color imagecolorclosestalpha($im,222,140,33,10-$i*10);
  
imagettftext($im$size$angle70-$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
2006-11-3 02:14 PM#1
查看资料  发短消息  顶部
 
cnu2m
新手上路
Rank: 1
初级会员


UID 63678
精华 0
积分 19
帖子 27
金钱 19 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2005-3-23
状态 离线
[广告]: Enom域名自助付费 自助注册 自助PUSH 主流域名COM等一律57.99元年
我也碰到这个问题了...
本地的GD
gd
GD Support  enabled  
GD Version  bundled (2.0.28 compatible)  
FreeType Support  enabled  
FreeType Linkage  with freetype  
FreeType Version  2.1.10  
GIF Read Support  enabled  
GIF Create 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 TTF library  
FreeType Version  1.4  
GIF Read Support  enabled  
GIF Create Support  enabled  
PNG Support  enabled  
WBMP Support  enabled  
XBM Support  enabled  
我是生成gif图片,然后印文字上去,结果,图片生成了,但是文字没有上去
2006-11-5 01:28 AM#2
查看资料  发短消息  QQ  顶部
 
cnu2m
新手上路
Rank: 1
初级会员


UID 63678
精华 0
积分 19
帖子 27
金钱 19 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2005-3-23
状态 离线
[推荐阅读] 今天才发现一个mssql与adodb的严重问题
楼主,我的问题已经解决.我把FreeType Version升级到2.2.1就可以了
2006-11-6 06:26 AM#3
查看资料  发短消息  QQ  顶部
 
yanglei1979 (高老庄二庄主)
高级会员
Rank: 4
天蓬元帅


UID 73676
精华 0
积分 735
帖子 711
金钱 735 喜悦币
威望 0
人脉 0
阅读权限 50
注册 2006-5-19
来自 深圳
状态 离线
[推荐阅读] 如何在<option>加入详细信息?
HELLO



QUOTE:
原帖由 cnu2m 于 2006-11-6 06:26 AM 发表
楼主,我的问题已经解决.我把FreeType Version升级到2.2.1就可以了
你是怎么升级的,能详细说一下吗
2006-11-8 01:36 AM#4
查看资料  访问主页  发短消息  QQ  Yahoo!  顶部
     


  可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题 | 开通个人空间  


 




Powered by Discuz! 6.1.0  © 2001-2010 Comsenz Inc.
Processed in 0.024067 second(s), 6 queries

(冀ICP备05009913号) 管理员:sadly 邮箱/MSN: sadly@phpx.com QQ:824008(长隐) 清除 Cookies - - Archiver - WAP