PHP水印脚本使用GD库函数imagejpeg错误 [英] PHP Water mark script with using GD library function imagejpeg Error

查看: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: http://www.mysite.com/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错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆