Skip to content
Discussion options

You must be logged in to vote

Images are embedded in the generated html source like this:

This means that the string (!) following "base64," is encoded in base64 format. You must parse that string completely and decode it (e.g. binascii module or b64_decode) into your bytes object.
Then define fp = io.BytesIO(obj.getvalue()) and do img = PIL.Image.open(fp).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mahdyshabeeb
Comment options

Answer selected by mahdyshabeeb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants