clear all cached sizes

This commit is contained in:
j 2016-01-16 10:47:52 +05:30
commit b899768130
4 changed files with 39 additions and 22 deletions

View file

@ -391,3 +391,10 @@ def _to_json(python_object):
return '%d-%02d-%02dT%02d:%02d%02dZ' % tuple(list(tt)[:6])
return python_object.strftime('%Y-%m-%dT%H:%M:%SZ')
raise TypeError(u'%s %s is not JSON serializable' % (repr(python_object), type(python_object)))
def get_ratio(data):
try:
img = Image.open(BytesIO(data))
return img.size[0]/img.size[1]
except:
return 1