PHP Water mark script with using GD library function imagejpeg Error

ⅰ亾dé卋堺 提交于 2019-12-11 22:03:14

问题


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

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

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


回答1:


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

In PHP 5.3

imagejpeg($image, '', 100);

in 5.4

imagejpeg($image, NULL, 100);

Hope this would help someone.



来源:https://stackoverflow.com/questions/19888246/php-water-mark-script-with-using-gd-library-function-imagejpeg-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!