I\'m making a simple API in Flask that accepts an image encoded in base64, then decodes it for further processing using Pillow.
I\'ve looked at some examples (1, 2,
I'm using the ways mentioned above. But I'm getting this error at Image.open
:
cannot identify image file <_io.BytesIO object at 0x11c267590>
.
This is my code:
image_data = re.sub('^data:image/.+;base64,', '', testBase64)
data = Image.open(io.BytesIO(base64.b64decode(image_data)))
Any ideas/ suggestions?