OSError: cannot identify image file <_io.BytesIO object at 0x0304E630>

老师您好,这是片段代码,当走到 imgs = Image.open(img_map)这步是代码就会报 cannot identify image file <_io.BytesIO object at 0x0302E630>,请问是什么原因,怎么修改,谢谢。
def get_screenmap():
process = subprocess.Popen('adb shell screencap -p', shell=True, stdout=subprocess.PIPE)
screenmap = process.stdout.read()
screenmap = screenmap.replace(b'\r\r\n',b'\n')
img_map = io.BytesIO()
img_map.write(screenmap)
imgs = Image.open(img_map)

fish - Hadooper

赞同来自:

这是什么课程的问题?

兴东ocean

赞同来自:

python,读取图片

要回复问题请先登录注册