From b5d973e2d45adfa914a6370e6795691f4b4b5ad9 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Wed, 11 Dec 2013 00:01:29 +0100 Subject: [PATCH] Only resize really big images. --- dosagelib/events.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dosagelib/events.py b/dosagelib/events.py index e51e03afb..6b64020ea 100644 --- a/dosagelib/events.py +++ b/dosagelib/events.py @@ -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