PHP水印脚本使用GD库函数imagejpeg错误

编程入门 行业动态 更新时间:2024-10-23 12:31:59
本文介绍了PHP水印脚本使用GD库函数imagejpeg错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一直在此处在我的网站上的图像上创建水印.从上个月开始,此脚本正在处理的图像未显示.我在Firebug控制台中收到以下错误.

I have been using the Watermark script used here for creating water mark on image on my site. From last month the images that are being process by this script are not showing. I get the following error in firebug console.

Image corrupt or truncated: www.mysite/data/10.jpg

在查看服务器的错误日志时,我在这里有这行

Looking at the error log for server i have this line there

PHP Warning: imagejpeg(): Filename cannot be empty in /home/mysite/public_html/data/watermark.php on line 80

请建议问题出在哪里.我检查了显示GD库已启用的服务器信息.

Please suggest where the issue is. I checked server info which shows GD library is enabled.

PS:这在我的本地服务器上正常运行.我在本地和在线5.4.19上都有PHP版本5.3.1.

PS: This is working correctly on my local server. I have PHP Version 5.3.1 on local and 5.4.19 Online.

推荐答案

弄清楚了这一点.这是PHP版本的问题.

Figured this Out. It was an issue with PHP version.

在PHP 5.3

imagejpeg($image, '', 100);

在 5.4

imagejpeg($image, NULL, 100);

希望这会对某人有所帮助.

Hope this would help someone.

更多推荐

PHP水印脚本使用GD库函数imagejpeg错误

本文发布于:2023-11-01 02:21:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1547975.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:水印   脚本   错误   库函数   PHP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!