I'm receiving an image from a form in base64 which I would like to convert back to a PNG file type.
To do this I tried the following methods
attempt1 = base64.b64decode(picture.data)
attempt2 = picture.data.decode('base64')
but I received the error Error: Incorrect padding
.
I saw this answer and tried using the function however I get the same error.
What can I do to fix this issue? Thanks.
Edit
my base64 image looks like this (The list of characters are much longer):
data:image/png;base64, OouhoGUiyf+YdiHl==