forked from MarseyWorld/MarseyWorld
gfdgf
parent
912ad9aaa7
commit
848749e09a
|
@ -232,7 +232,7 @@ def api_comment(v):
|
|||
file=request.files["file"]
|
||||
if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400
|
||||
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.webp2'
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.gif'
|
||||
file.save(name)
|
||||
url = request.host_url[:-1] + process_image(name)
|
||||
|
||||
|
@ -633,7 +633,7 @@ def edit_comment(cid, v):
|
|||
file=request.files["file"]
|
||||
if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400
|
||||
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.webp2'
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.gif'
|
||||
file.save(name)
|
||||
url = request.host_url[:-1] + process_image(name)
|
||||
|
||||
|
|
|
@ -472,7 +472,7 @@ def thumbnail_thread(pid):
|
|||
db.close()
|
||||
return
|
||||
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.webp2'
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.gif'
|
||||
|
||||
with open(name, "wb") as file:
|
||||
for chunk in image_req.iter_content(1024):
|
||||
|
@ -725,7 +725,7 @@ def submit_post(v):
|
|||
), 403
|
||||
|
||||
if file.content_type.startswith('image/'):
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.webp2'
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.gif'
|
||||
file.save(name)
|
||||
new_post.url = request.host_url[:-1] + process_image(name)
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ def settings_profile_post(v):
|
|||
if request.headers.get("Authorization"): return {"error": f"Image files only"}, 400
|
||||
else: return render_template("settings_profile.html", v=v, error=f"Image files only."), 400
|
||||
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.webp2'
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.gif'
|
||||
file.save(name)
|
||||
url = request.host_url[:-1] + process_image(name)
|
||||
|
||||
|
@ -506,7 +506,7 @@ def settings_images_profile(v):
|
|||
|
||||
file = request.files["profile"]
|
||||
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.webp2'
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.gif'
|
||||
file.save(name)
|
||||
highres = request.host_url[:-1] + process_image(name)
|
||||
|
||||
|
@ -538,7 +538,7 @@ def settings_images_banner(v):
|
|||
|
||||
file = request.files["banner"]
|
||||
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.webp2'
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.gif'
|
||||
file.save(name)
|
||||
imageurl = request.host_url[:-1] + process_image(name)
|
||||
|
||||
|
|
Loading…
Reference in New Issue