图形处理 GD Library的问题

梦幻山河 2005-07-27 10:05:20
我的机子已经支持图形处理 GD Library了,
但我测试以下代码会报错:
<?
Header("Content-type: image/gif");
$im = imagecreate(400,30);
$black = ImageColorAllocate($im, 0,0,0);
$white = ImageColorAllocate($im, 255,255,255);
imageline($im, 1, 1, 350, 25, $black);
imagearc($im, 200, 15, 20, 20, 35, 190, $white);
imagestring($im, 5, 4, 10, "Graph TEST!!", $white);
ImageGif($im);
ImageDestroy($im);
?>
报错内容:
<br />
<b>Fatal error</b>: Call to undefined function: imagegif() in <b>F:\phptext\test2.php</b> on line <b>9</b><br />

我把ImageGif($im);
ImageDestroy($im);这两行删了,系统未报错,
不知道为什么?
...全文
310 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
allkill 2005-08-01
  • 打赏
  • 举报
回复
gif的版权早到了,现在新下的PHP都支持GIF了。
xgdzy 2005-08-01
  • 打赏
  • 举报
回复
看看header的解释吧
Every page downloaded from a web server is a result of an exchange of HTTP dialogue. The web browser sends a set of instructions to indicate which page it wants to view, and the server responds with a response that indicates the success of the request, along with various other information that is not displayed directly on the web page.

The following HTTP headers show some of the information that is sent along with a typical web page from a PHP-enabled web server:

HTTP/1.1 200 OK
Date: Tue, 14 Dec 2004 21:17:28 GMT
Server: Apache/1.3.29 (Unix) mod_gzip/1.3.26.1a PHP/4.3.9
mod_ssl/2.8.16 OpenSSL/0.9.7c
X-Powered-By: PHP/4.3.9
Connection: close
Content-Type: text/html; charset=iso-8859-1

patchclass 2005-07-30
  • 打赏
  • 举报
回复
暂时不支持gif的图片:(
zhutimy 2005-07-30
  • 打赏
  • 举报
回复
你的GB不支持GIF
taft 2005-07-30
  • 打赏
  • 举报
回复
最新的gd都支持gif了,在php手册上有详细的说明。
Header("Content-type: image/gif"); 是 html协议的头输出,在之前不能有html的正文内容输出,估计是在header()前你echo 了什么东西
ivan19820109 2005-07-29
  • 打赏
  • 举报
回复
去http://33990521.go.nease.net下一个吧
cokeyang 2005-07-29
  • 打赏
  • 举报
回复
Header("Content-type: image/gif");
header函数前面本来就不能有任何输出!!看看手册!!

不支持gif是因为版权的问题!
梦幻山河 2005-07-27
  • 打赏
  • 举报
回复
我下了个libpng-1.2.8-src.exe,
但只支持png的图,
gif还是不支持,
还有一个问题,Header("Content-type: image/gif");这行代码之前为什么不能插入html代码,一插就报错,如果这样我怎么能在页面里插入图象?
玄之丞 2005-07-27
  • 打赏
  • 举报
回复
低于 gd-1.6 版本的 GD 支持 GIF 图像格式,不支持 PNG,高于 gd-1.6 的版本支持 PNG,不支持 GIF。


你的PHP版本中,没有GIF图像库,

建议去下一个

21,891

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧