From 8fcc91a43e27552f2052d71a31c6d648eecb1b4f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 26 Sep 2022 03:15:36 +0200 Subject: [PATCH] reduce resize values --- files/routes/asset_submissions.py | 4 ++-- files/routes/comments.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/files/routes/asset_submissions.py b/files/routes/asset_submissions.py index ecd4c0f4b..dd1f9c2c9 100644 --- a/files/routes/asset_submissions.py +++ b/files/routes/asset_submissions.py @@ -76,7 +76,7 @@ def submit_marsey(v): filename = f'/asset_submissions/marseys/{name}.webp' copyfile(highquality, filename) - process_image(filename, resize=250, trim=True) + process_image(filename, resize=200, trim=True) marsey = Marsey(name=name, author_id=author.id, tags=tags, count=0, submitter_id=v.id) g.db.add(marsey) @@ -391,7 +391,7 @@ def update_marsey(v): filename = f"files/assets/images/emojis/{name}.webp" copyfile(new_path, filename) - process_image(filename, resize=250, trim=True) + process_image(filename, resize=200, trim=True) requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, data=f'{{"files": ["https://{SITE}/e/{name}.webp", "https://{SITE}/assets/images/emojis/{name}.webp", "https://{SITE}/asset_submissions/marseys/original/{name}.{format}"]}}', timeout=5) diff --git a/files/routes/comments.py b/files/routes/comments.py index e73b9ecab..556b850e0 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -201,7 +201,7 @@ def comment(v): num = int(li.split('.webp')[0]) + 1 filename = f'files/assets/images/{SITE_NAME}/sidebar/{num}.webp' copyfile(oldname, filename) - process_image(filename, 600) + process_image(filename, resize=400) elif parent_post.id == BANNER_THREAD: li = sorted(os.listdir(f'files/assets/images/{SITE_NAME}/banners'), key=lambda e: int(e.split('.webp')[0]))[-1]