fdsfds
This commit is contained in:
parent
6a986e1eb3
commit
e402c02371
5 changed files with 8 additions and 8 deletions
BIN
files/assets/images/loading.webp
Normal file
BIN
files/assets/images/loading.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
|
@ -121,7 +121,7 @@ def sanitize(sanitized, noimages=False):
|
|||
tag["class"] = "in-comment-image"
|
||||
tag["loading"] = "lazy"
|
||||
tag["data-src"] = tag["src"]
|
||||
tag["src"] = "/assets/images/default_thumb_link.webp"
|
||||
tag["src"] = "/assets/images/loading.webp"
|
||||
|
||||
link = soup.new_tag("a")
|
||||
link["href"] = tag["data-src"]
|
||||
|
|
|
@ -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)}.gif'
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.webp2'
|
||||
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)}.gif'
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.webp2'
|
||||
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)}.gif'
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.webp2'
|
||||
|
||||
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)}.gif'
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.webp2'
|
||||
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)}.gif'
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.webp2'
|
||||
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)}.gif'
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.webp2'
|
||||
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)}.gif'
|
||||
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.webp2'
|
||||
file.save(name)
|
||||
imageurl = request.host_url[:-1] + process_image(name)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue