使用GD2函数在照片上添加文字出现错误~

JesonPark 2015-05-20 10:47:14
出现这样的错误怎么解决啊,试了好多办法都不行。!

<br />
<b>Warning</b>: imagecreatefromjpeg(/images/photo.jpg): failed to open stream: No such file or directory in <b>C:\Apache24\htdocs\Excerse\index.php</b> on line <b>3</b><br />
<br />
<b>Warning</b>: imagecolorallocate() expects parameter 1 to be resource, boolean given in <b>C:\Apache24\htdocs\Excerse\index.php</b> on line <b>4</b><br />
<br />
<b>Warning</b>: imagettftext() expects parameter 1 to be resource, boolean given in <b>C:\Apache24\htdocs\Excerse\index.php</b> on line <b>7</b><br />
<br />
<b>Warning</b>: imagejpeg() expects parameter 1 to be resource, boolean given in <b>C:\Apache24\htdocs\Excerse\index.php</b> on line <b>8</b><br />
<br />
<b>Warning</b>: imagedestroy() expects parameter 1 to be resource, boolean given in <b>C:\Apache24\htdocs\Excerse\index.php</b> on line <b>9</b><br />
...全文
165 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
JesonPark 2015-05-22
  • 打赏
  • 举报
回复
问题解决啦。好像是文件目录的权限问题。我的php网页如果在图片目录级别之上,就可以。但如果在同一级别或者低于图片目录级别,就加载不了。~谢谢各位了。
一起混吧 2015-05-21
  • 打赏
  • 举报
回复
用IDE运行会有偏差的,还是用浏览器运行吧。浏览器运行没问题就行。
果酱很好吃 2015-05-21
  • 打赏
  • 举报
回复
提示图片不存在,获取不到图片资源,接下来都报错了 检查下文件路径
JesonPark 2015-05-21
  • 打赏
  • 举报
回复
我的路径是正确的,我只是搞不明白为什么我在DreamWeaver可以正常运行代码,在ZendStudio却不行。
xuzuning 2015-05-20
  • 打赏
  • 举报
回复
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 打开失败:没有这样的文件或目录

21,892

社区成员

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

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