globocom/thumbor — pull request #54 by dhardy92 (2012-01-10 15:36:01+00:00)
Title: Get TypeError: Incorrect padding for some files.

Hello,

For some files I get following error :
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/tornado/web.py", line 1040, in wrapper
return method(self, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/thumbor/handlers/crypto.py", line 29, in get
opt = cr.decrypt(crypto)
File "/usr/local/lib/python2.6/dist-packages/thumbor/crypto.py", line 63, in decrypt
debased = base64.urlsafe_b64decode(encrypted.encode("utf-8"))
File "/usr/lib/python2.6/base64.py", line 112, in urlsafe_b64decode
return b64decode(s, '-_')
File "/usr/lib/python2.6/base64.py", line 76, in b64decode
raise TypeError(msg)
TypeError: Incorrect padding

so I add '=' padding in the base64 string.