PNG上传后背景变黑
当我尝试上传 png 图像时,上传图像后图像的透明部分变成黑色...
我想知道如何解决这个问题,任何帮助将不胜感激,并提前致谢。
问候
Shabir吉尔卡
When i am trying to upload a png image, after uploading the images the transparent part of the image turns into black...
I would like to know howto fix this problem, any help will be highly appreciated and thanks in advance..
Regards
Shabir Gilkar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有很多不一致之处可能会导致这种情况。查看 imagecolortransparent 和 imagealphablending 函数。
您也可以在不使用过滤器的情况下上传原始数据,但可能会产生一些后果(例如,直接存储
$_FILE
而不进行 GD 处理)。如果这就是您正在做的事情,那么提供更多细节不会有什么坏处。There's a lot of inconsistencies that can cause that. Check out imagecolortransparent and imagealphablending functions.
You can also do the upload raw without a filter, but there may be consequences of that (e.g. storing
$_FILE
directly without GD processing). If that is what you're doing, a bit more detail wouldn't hurt.