您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

Python ValueError:从bash管道读取png文件时嵌入了空字节

Python ValueError:从bash管道读取png文件时嵌入了空字节

首先尝试将原始数据加载到BytesIO容器中:

from io import BytesIO
from PIL import Image
from subprocess import Popen, PIPE

data = Popen.communicate(Popen(['import','-w','0x02a00001','png:-'], stdout=PIPE))[0]
scr = Image.open(BytesIO(data))
python 2022/1/1 18:35:51 有347人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶