开发者

GD+PHP: Exception to see if imagefail fails?

开发者 https://www.devze.com 2023-04-10 06:54 出处:网络
imagetruecolortopalette($dst_image,true,$colorcount); imagepalettecopy($dst_image,$src_image); $transparentcolor = imagecolortransparent($src_image);
imagetruecolortopalette($dst_image,true,$colorcount);
imagepalettecopy($dst_image,$src_image);
$transparentcolor = imagecolortransparent($src_image);
imagefill($dst_image,0,0,$transparentcolor);
imagecolortransparent($dst_image,$transparentcolor);

So I want something开发者_JAVA百科 like: if imagefill fails unlink exit with error else continue with imagefill

Or: if imagefill takes more than X seconds unlink exit with error else continue with imagefill

Any ideas? Please help.


I ended up switching over to imagemagick.

-Two times faster. -Uses less memory. -No more errors.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号