Monday, 9 September 2013

Decoding PNG DataURL urlopen vs base64decode

Decoding PNG DataURL urlopen vs base64decode

I have PNG image coded to DataURL representation. It starts regularly:
u'data:image/png;base64,... but it has no == ending. base64.b64decode
raises TypeError: Incorrect padding, but urllib.urlopen returns proper
value - an image which successfully opens by image viewer.
Here is that encoded string:
http://www.sendspace.com/file/8l61im
Its difficult to formulate actual question here - I just wonder what is
the reason of that issue - is it particular buggy string, and urlopen just
has more 'tolerant' algorithm, or something else? Kindly help!

No comments:

Post a Comment