当前位置:Gxlcms > PHP教程 > 使用GD2函数在照片上添加文字出现异常

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

时间:2021-07-01 10:21:17 帮助过:58人阅读

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

人气教程排行