【发布时间】:2020-03-30 12:03:52
【问题描述】:
我有一个代码可以获取 base 64 格式的图像,如下所示:-
import base64
import requests
img=requests.get('https://example.com/hello.jpg')
base=base64.b64encode(img.content)
base=base.decode('utf-8')
print(base)
html:-
<img src="data:image/jpeg;base64,<base64_data>" width="20" height="20">
我可以获得 base64 格式的图像,并可以在浏览器中使用它们,例如 html 格式的 chrome。但在 Internet Explorer 中,我只能显示一些图像。显示带有短 base64 的图像,但长则不显示。我该如何解决?
【问题讨论】:
标签: python html image internet-explorer base64