From 68cecc52ab2d7b980e686601bd67215352aeea96 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 28 May 2021 05:01:25 +0200 Subject: [PATCH] dont grow thumbs --- copyparty/th_srv.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/copyparty/th_srv.py b/copyparty/th_srv.py index 87e86867..1afdf071 100644 --- a/copyparty/th_srv.py +++ b/copyparty/th_srv.py @@ -231,7 +231,10 @@ class ThumbSrv(object): try: im.thumbnail(res2, resample=Image.LANCZOS) if crop: - im = ImageOps.fit(im, self.res, method=Image.LANCZOS) + iw, ih = im.size + dw, dh = self.res + res = (min(iw, dw), min(ih, dh)) + im = ImageOps.fit(im, res, method=Image.LANCZOS) except: im.thumbnail(self.res)