fd
This commit is contained in:
parent
85cb000194
commit
ece0a0dbd7
2 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@ import calendar
|
||||||
from sqlalchemy.orm import lazyload
|
from sqlalchemy.orm import lazyload
|
||||||
import imagehash
|
import imagehash
|
||||||
from os import remove
|
from os import remove
|
||||||
|
from os.path import exists
|
||||||
from PIL import Image as IMAGE
|
from PIL import Image as IMAGE
|
||||||
|
|
||||||
from files.helpers.wrappers import *
|
from files.helpers.wrappers import *
|
||||||
|
|
|
@ -504,7 +504,7 @@ def thumbs(new_post):
|
||||||
for chunk in image_req.iter_content(1024):
|
for chunk in image_req.iter_content(1024):
|
||||||
file.write(chunk)
|
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)
|
else: post.thumburl = upload_imgur(filepath="image.png", resize=True)
|
||||||
|
|
||||||
g.db.add(post)
|
g.db.add(post)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue