From d09c81d65e2c035b788f3f9ff600bd7b5b93f0ed Mon Sep 17 00:00:00 2001 From: eclipse Date: Tue, 3 Jun 2025 10:54:23 +0200 Subject: [PATCH] fixed a bug --- the_works/views/titelbild.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/the_works/views/titelbild.py b/the_works/views/titelbild.py index 85e0b2e..db378d9 100644 --- a/the_works/views/titelbild.py +++ b/the_works/views/titelbild.py @@ -56,7 +56,7 @@ def create(): bytes_io.seek(0) img = Image.open(bytes_io) w, h, img_format = img.width, img.height, img.format - img.thumbnail(dimensions) + img.thumbnail([128, 128]) tn = BytesIO() img.save(tn, format=img_format) @@ -138,13 +138,3 @@ def makeshift_digest(bytes_io): h.update(mv[:n]) return h.hexdigest() - -# takes a BytesIO object containing an image and creates a Pillow thumbnail from it -def _process_image_bytes(bytes_io, dimensions=[128, 128]): - bytes_io.seek(0) - img = Image.open(bytes_io) - tn_format = img.format - img.thumbnail(dimensions) - tn = BytesIO() - img.save(tn, format=tn_format) - return (tn.getvalue(), tn_format)