1.图片转base64,url指图片路径
def ToBase64(url): with open(url,'rb') as f: base64_data=base64.b64encode(f.read()) s=base64_data.decode() #print(url+"已转base64") return s
2.图片直接在网页打开: “data:image/gif;base64,”后面加上base64码流即可
gao109214 |
|
||
慎独 主敬 求仁 习劳 |
Copyright © 2024 憋玩意
Powered by .NET 9.0 on Kubernetes |