From 4b8021b8b12edbd03ded0a94aed04505c1593f6d Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 10 Sep 2021 05:25:42 +0200 Subject: [PATCH] fd --- files/routes/admin.py | 1 + files/routes/posts.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index 973dc965a..0df9a9fb7 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -3,6 +3,7 @@ import calendar from sqlalchemy.orm import lazyload import imagehash from os import remove +from os.path import exists from PIL import Image as IMAGE from files.helpers.wrappers import * diff --git a/files/routes/posts.py b/files/routes/posts.py index 666fc2319..3c92005c9 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -504,7 +504,7 @@ def thumbs(new_post): for chunk in image_req.iter_content(1024): file.write(chunk) - if 'pcmemes.net' in request.host: post.thumburl = upload_ibb(f"image.png", True) + if 'pcmemes.net' in request.host: post.thumburl = upload_ibb(filepath="image.png", resize=True) else: post.thumburl = upload_imgur(filepath="image.png", resize=True) g.db.add(post)