From 892bfc21bd33b2a6007fd84dc198e9ccb6940123 Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Fri, 20 Jan 2023 15:25:38 +0100 Subject: [PATCH] forgot to scale on forced generate. Now fixed --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index d503e1e..c32a0dd 100644 --- a/main.py +++ b/main.py @@ -79,9 +79,9 @@ def generate(): generated = generated + 1 elif Path(config.THUMBNAIL_DIR + "/" + str(CVDB) + ".jpg").exists() == False: cover = s.open(filelist[1]).read() - c = open(config.THUMBNAIL_DIR + "/" + str(CVDB) + ".jpg", 'wb+') - c.write(cover) - c.close() + image = Image.open(BytesIO(cover)) + image.thumbnail(config.MAXSIZE,Image.ANTIALIAS) + image.save(config.THUMBNAIL_DIR + "/" + str(CVDB) + ".jpg") generated = generated + 1 else: skippedcount = skippedcount + 1