clear all cached sizes
This commit is contained in:
parent
d0e2fe0340
commit
b899768130
4 changed files with 39 additions and 22 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue