Only resize really big images.
This commit is contained in:
parent
de3ec38012
commit
b5d973e2d4
1 changed files with 3 additions and 1 deletions
|
@ -123,6 +123,8 @@ def getDimensionForImage(filename, maxsize):
|
|||
except ImportError:
|
||||
return None
|
||||
img = Image.open(filename)
|
||||
width, height = img.size
|
||||
if width > maxsize and height > maxsize:
|
||||
img.thumbnail(maxsize)
|
||||
return img.size
|
||||
|
||||
|
|
Loading…
Reference in a new issue