From bbf07f440104f45ede452eb3939439ab53781db7 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 22 Jul 2018 17:57:39 -0700 Subject: [PATCH] Fix image thumbnail wrong variable bug. How long has that been there? --- etiquette/helpers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etiquette/helpers.py b/etiquette/helpers.py index 6b5b2cb..696868a 100644 --- a/etiquette/helpers.py +++ b/etiquette/helpers.py @@ -156,14 +156,14 @@ def fit_into_bounds(image_width, image_height, frame_width, frame_height): def generate_image_thumbnail(filepath, width, height): image = PIL.Image.open(filepath) - (width, height) = image.size + (image_width, image_height) = image.size (new_width, new_height) = fit_into_bounds( - image_width=width, - image_height=height, + image_width=image_width, + image_height=image_height, frame_width=width, frame_height=height, ) - if new_width < width: + if new_width < image_width or new_height < image_height: image = image.resize((new_width, new_height)) if image.mode == 'RGBA':