0
点赞
收藏
分享

微信扫一扫

lua base64 保存为图片文件

滚过红尘说红尘 2022-02-17 阅读 227

将获取到的base64字节流,保存为图片文件,源码如下:

local bs = "base64图片编码后数据"

bs = string.gsub(bs,"data:image/png;base64,","")

local ff = base64.decode(bs)

local file = io.open("a.png", "wb")
file:write(ff)
file:close()

 

举报

相关推荐

0 条评论