>  기사  >  백엔드 개발  >  使用GD2函数在照片上添加文字出现异常

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

WBOY
WBOY원래의
2016-06-13 12:20:201604검색

使用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运行会有偏差的,还是用浏览器运行吧。浏览器运行没问题就行。

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
이전 기사:,smarty循环不显示다음 기사:php缺标签