Only resize really big images.

This commit is contained in:
Bastian Kleineidam 2013-12-11 00:01:29 +01:00
parent de3ec38012
commit b5d973e2d4

View file

@ -123,7 +123,9 @@ def getDimensionForImage(filename, maxsize):
except ImportError:
return None
img = Image.open(filename)
img.thumbnail(maxsize)
width, height = img.size
if width > maxsize and height > maxsize:
img.thumbnail(maxsize)
return img.size