1

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!

upd
Tried urlsafe_b64decode - and with it I got:
TypeError: character mapping must return integer, None or unicode

Gill Bates
  • 14,330
  • 23
  • 70
  • 138
  • http://stackoverflow.com/questions/2941995/python-ignore-incorrect-padding-error-when-base64-decoding – eri Sep 09 '13 at 18:03

0 Answers0