python 图片转base64
2020-03-07 python 1325
def img2base64(imgpath): with open(imgpath, "rb") as f: base64_data = base64.b64encode(f.read()) s = base64_data.decode() print("data:image/png;base64,%s" % s)
很赞哦! (0)
相关文章
文章评论
-
-
-
0条评论