PHP Water mark script with using GD library functi

2019-09-09 09:58发布

问题:

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.



标签: php gd