php gd 函数不能调用

bugttp 2009-05-01 07:01:25
gd
GD Support enabled
GD Version bundled (2.0.34 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

=====================phpinfo的GD信息
System Windows NT CH-PC-043 5.2 build 3790
Build Date Apr 30 2008 16:18:05
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\WINDOWS
Loaded Configuration File D:\Program Files\PHPnow2\php-5.2.6-Win32\php-apache2handler.ini
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519
Debug Build no
Thread Safety enabled
Zend Memory Manager enabled
IPv6 Support disabled
Registered PHP Streams php, file, data, http, ftp, compress.zlib, zip
Registered Stream Socket Transports tcp, udp
Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, zlib.*
=====================服务器信息

<?
gd_version();
?>
错误信息:Fatal error: Call to undefined function gd_version()
...全文
360 14 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
bugttp 2009-05-02
  • 打赏
  • 举报
回复

<?
$size =imageCopyMerge('test.jpg', 'waterForImg.gif', 52, 52, 0, 0, 32, 30, 80);
print_r($size);
?>


Warning: imagecopymerge(): supplied argument is not a valid Image resource in F:\WWWROOT\www_test_com\x.php on line 1

这样可用了, 但测试有问题, test.jpg,waterForImg.gif都在www_test_com根目录下
lzl8146 2009-05-02
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 bugttp 的回复:]
<?
gd_version();
?>

为什么这样不行嘞?
[/Quote]
php里没有这个函数,当然不可以啦。。


getimagesize的用法,手册上讲的比较清楚了:
http://cn2.php.net/manual/en/function.getimagesize.php
bugttp 2009-05-02
  • 打赏
  • 举报
回复


<?
etimagesize();
?>



etimagesize怎么调用?
wang_quan_li 2009-05-02
  • 打赏
  • 举报
回复
php.ini中extension=php_gd2.dll前的注释取消,重启WEB服务器
lzl8146 2009-05-02
  • 打赏
  • 举报
回复
imagecreatefromjpeg('test.jpg');
bugttp 2009-05-02
  • 打赏
  • 举报
回复

$a = imagecreatefromjpeg( 'test.jpg' );
$b = imagecreatefromgif ( 'waterForImg.gif' );
$size =imageCopyMerge($a, $b, 52, 52, 0, 0, 32, 30, 80);
print_r($size);



bugttp 2009-05-02
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 lzl8146 的回复:]
PHP code$a=imagecreatefromgif ('test.jpg');$b=imagecreatefromgif ('waterForImg.gif');$size=imageCopyMerge($a,$b,52,52,0,0,32,30,80);print_r($size);

[/Quote]

Warning: imagecreatefromgif() [function.imagecreatefromgif]: 'test.jpg' is not a valid GIF file in F:\WWWROOT\www_test_com\x.php on line 13

Warning: imagecopymerge(): supplied argument is not a valid Image resource in F:\WWWROOT\www_test_com\x.php on line 15

===================================================
附:gd_info()

array(12) { ["GD Version"]=> string(27) "bundled (2.0.34 compatible)" ["FreeType Support"]=> bool(true) ["FreeType Linkage"]=> string(13) "with freetype" ["T1Lib Support"]=> bool(true) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(true) ["JPG Support"]=> bool(true) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XPM Support"]=> bool(false) ["XBM Support"]=> bool(true) ["JIS-mapped Japanese Font Support"]=> bool(false) }
lzl8146 2009-05-02
  • 打赏
  • 举报
回复
$a = imagecreatefromgif ( 'test.jpg' );
$b = imagecreatefromgif ( 'waterForImg.gif' );

$size =imageCopyMerge($a, $b, 52, 52, 0, 0, 32, 30, 80);
print_r($size);



bugttp 2009-05-02
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 xuzuning 的回复:]
是在两个图像资源间拷贝,而非图片间拷贝

[/Quote]


什么意思啊
xuzuning 2009-05-02
  • 打赏
  • 举报
回复
是在两个图像资源间拷贝,而非图片间拷贝
bugttp 2009-05-02
  • 打赏
  • 举报
回复
怎么没人回答啊........................

·¥#%·#¥……·#¥……·%
lzl8146 2009-05-01
  • 打赏
  • 举报
回复
We also can read the constant GD_VERSION since PHP 5.2.4
bugttp 2009-05-01
  • 打赏
  • 举报
回复
<?
gd_version();
?>

为什么这样不行嘞?
lzl8146 2009-05-01
  • 打赏
  • 举报
回复
用gd_info()试试

<?php
var_dump(gd_info());
?>

21,893

社区成员

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

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