vcxxvc
This commit is contained in:
parent
cbaaaf8ece
commit
2b5adb3e81
2 changed files with 4 additions and 2 deletions
|
@ -11,7 +11,7 @@ def process_image(file=None, filename=None, resize=0):
|
||||||
file.save(filename)
|
file.save(filename)
|
||||||
i = IImage.open(file)
|
i = IImage.open(file)
|
||||||
else: i = IImage.open(filename)
|
else: i = IImage.open(filename)
|
||||||
except: abort(400)
|
except: return ""
|
||||||
|
|
||||||
if resize:
|
if resize:
|
||||||
size = resize, resize
|
size = resize, resize
|
||||||
|
|
|
@ -195,7 +195,9 @@ def api_comment(v):
|
||||||
if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1":
|
if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1":
|
||||||
file=request.files["file"]
|
file=request.files["file"]
|
||||||
if file.content_type.startswith('image/'):
|
if file.content_type.startswith('image/'):
|
||||||
body += f"\n\n})"
|
image = process_image(file)
|
||||||
|
if image == "": return {"error":"Image upload failed"}
|
||||||
|
body += f"\n\n"
|
||||||
if v.admin_level == 3:
|
if v.admin_level == 3:
|
||||||
if parent_post.id == 37696:
|
if parent_post.id == 37696:
|
||||||
filename = 'files/assets/images/Drama/sidebar/' + str(len(listdir('files/assets/images/Drama/sidebar'))+1) + '.webp'
|
filename = 'files/assets/images/Drama/sidebar/' + str(len(listdir('files/assets/images/Drama/sidebar'))+1) + '.webp'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue