格式,传到后端django,但pillow是无法直接读取base64格式的图片的,所以特地查阅了一些资料,发现python3内置了base64转换函数,这里分享一下使用方法...
import os,...打印图像转换base64格式的字符串,type结果为
print(bs64_str, type(bs64_str))
# 将base64格式的数据装换为二进制数据...encode("utf-8"))
print("bs64格式的文本(伪加密)",bs64_my_time)
my_time = base64.b64decode(bs64_my_time).decode...("utf-8")
print("原文本:",my_time)
base64图片在网页上的表现形式
# 使用正则从上面src中抽取base64格式的图片信息
file = re.match(r"data:image/jpeg;base64,(.*)", file