fd
This commit is contained in:
parent
a224f5847b
commit
b3413074b8
3 changed files with 1 additions and 3 deletions
|
@ -42,7 +42,7 @@ def upload_ibb(filepath=None, file=None, resize=False):
|
||||||
return url
|
return url
|
||||||
|
|
||||||
|
|
||||||
def upload_ibb(filepath=None, file=None, resize=False):
|
def upload_imgur(filepath=None, file=None, resize=False):
|
||||||
|
|
||||||
if filepath: file = IImage.open(file)
|
if filepath: file = IImage.open(file)
|
||||||
file.save(f"image.{file.format}", optimize=True, quality=30)
|
file.save(f"image.{file.format}", optimize=True, quality=30)
|
||||||
|
|
|
@ -3,7 +3,6 @@ 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 *
|
||||||
|
|
|
@ -497,7 +497,6 @@ def thumbs(new_post):
|
||||||
image = PILimage.open(BytesIO(x.content))
|
image = PILimage.open(BytesIO(x.content))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
print(f'Unknown content type {x.headers.get("Content-Type")}')
|
print(f'Unknown content type {x.headers.get("Content-Type")}')
|
||||||
return False, f'Unknown content type {x.headers.get("Content-Type")} for submitted content'
|
return False, f'Unknown content type {x.headers.get("Content-Type")} for submitted content'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue