Home  >  Article  >  Backend Development  >  使用GD2函数在照片上添加文字出现异常

使用GD2函数在照片上添加文字出现异常

WBOY
WBOYOriginal
2016-06-13 12:20:201603browse

使用GD2函数在照片上添加文字出现错误~
出现这样的错误怎么解决啊,试了好多办法都不行。!



Warning:  imagecreatefromjpeg(/images/photo.jpg): failed to open stream: No such file or directory in C:\Apache24\htdocs\Excerse\index.php on line 3



Warning:  imagecolorallocate() expects parameter 1 to be resource, boolean given in C:\Apache24\htdocs\Excerse\index.php on line 4



Warning:  imagettftext() expects parameter 1 to be resource, boolean given in C:\Apache24\htdocs\Excerse\index.php on line 7



Warning:  imagejpeg() expects parameter 1 to be resource, boolean given in C:\Apache24\htdocs\Excerse\index.php on line 8



Warning:  imagedestroy() expects parameter 1 to be resource, boolean given in C:\Apache24\htdocs\Excerse\index.php on line 9

------解决思路----------------------
Warning: imagecreatefromjpeg(/images/photo.jpg): failed to open stream: No such file or directory in C:\Apache24\htdocs\Excerse\index.php on line 3

failed to open stream: No such file or directory 打开失败:没有这样的文件或目录

------解决思路----------------------
提示图片不存在,获取不到图片资源,接下来都报错了
检查下文件路径
------解决思路----------------------
用IDE运行会有偏差的,还是用浏览器运行吧。浏览器运行没问题就行。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:,smarty循环不显示Next article:php缺标签