Full res capture not identified as image in PIL
Running
img = microscope.capture_image(params = {
"use_video_port": False
})
gives error message
--> 133 image = PIL.Image.open(io.BytesIO(r.content))
134 return image
135
c:\Users\jakna\Source\sharp\.venv\lib\site-packages\PIL\Image.py in open(fp, mode)
2928 for message in accept_warnings:
2929 warnings.warn(message)
-> 2930 raise UnidentifiedImageError(
2931 "cannot identify image file %r" % (filename if filename else fp)
2932 )
UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x00000189AEB9E400>
Setting use_video_port to True works as intended. Looking online, it might be that the io.BytesIO object is missing the header that allows PIL to identify the image format.