Only resize really big images.
This commit is contained in:
parent
de3ec38012
commit
b5d973e2d4
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue