pain
This commit is contained in:
parent
472fe8e1ba
commit
879b206805
5 changed files with 33 additions and 35 deletions
|
@ -1,34 +1,23 @@
|
|||
from PIL import Image, ImageSequence, ImageOps
|
||||
from PIL import Image, ImageOps
|
||||
from PIL.ImageSequence import Iterator
|
||||
from webptools import gifwebp
|
||||
import subprocess
|
||||
|
||||
def process_image(filename=None, resize=0):
|
||||
|
||||
i = Image.open(filename)
|
||||
|
||||
exif = i.getexif()
|
||||
for k in exif.keys():
|
||||
if k != 0x0112:
|
||||
exif[k] = None
|
||||
del exif[k]
|
||||
i.info["exif"] = exif.tobytes()
|
||||
|
||||
if resize and i.width > resize:
|
||||
size = resize, resize
|
||||
frames = ImageSequence.Iterator(i)
|
||||
|
||||
def thumbnails(frames):
|
||||
for frame in frames:
|
||||
thumbnail = frame.copy()
|
||||
thumbnail.thumbnail(size)
|
||||
yield thumbnail
|
||||
|
||||
frames = thumbnails(frames)
|
||||
|
||||
om = next(frames)
|
||||
om.info = i.info
|
||||
om = ImageOps.exif_transpose(om)
|
||||
om.save(filename, format="WEBP", save_all=True, append_images=list(frames), loop=0, method=6, allow_mixed=True)
|
||||
subprocess.call(["convert", filename, "-coalesce", "-resize", f"{resize}>", filename])
|
||||
elif i.format.lower() != "webp":
|
||||
|
||||
exif = i.getexif()
|
||||
for k in exif.keys():
|
||||
if k != 0x0112:
|
||||
exif[k] = None
|
||||
del exif[k]
|
||||
i.info["exif"] = exif.tobytes()
|
||||
|
||||
if i.format.lower() == "gif":
|
||||
gifwebp(input_image=filename, output_image=filename, option="-mixed -metadata none -f 100 -mt -m 6")
|
||||
else:
|
||||
|
|
|
@ -126,7 +126,9 @@ def submit_get(v, sub=None):
|
|||
|
||||
if request.path.startswith('/s/') and not sub: abort(404)
|
||||
|
||||
return render_template("submit.html", SUBS=tuple(x[0] for x in g.db.query(Sub.name).order_by(Sub.name).all()), v=v, sub=sub, ghost=submit_ghost(v,g.db))
|
||||
SUBS = () if SITE_NAME == 'Drama' and not sub else tuple(x[0] for x in g.db.query(Sub.name).order_by(Sub.name).all())
|
||||
|
||||
return render_template("submit.html", SUBS=SUBS, v=v, sub=sub, ghost=submit_ghost(v,g.db))
|
||||
|
||||
@app.get("/post/<pid>")
|
||||
@app.get("/post/<pid>/<anything>")
|
||||
|
@ -853,10 +855,12 @@ def submit_post(v, sub=None):
|
|||
|
||||
def error(error):
|
||||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": error}, 403
|
||||
return render_template("submit.html", SUBS=tuple(x[0] for x in g.db.query(Sub.name).order_by(Sub.name).all()), v=v, error=error, title=title, url=url, body=body, ghost=submit_ghost(v,g.db)), 400
|
||||
|
||||
SUBS = () if SITE_NAME == 'Drama' and not sub else tuple(x[0] for x in g.db.query(Sub.name).order_by(Sub.name).all())
|
||||
return render_template("submit.html", SUBS=SUBS, v=v, error=error, title=title, url=url, body=body, ghost=submit_ghost(v,g.db)), 400
|
||||
|
||||
|
||||
if not sub: sub = request.values.get("sub")
|
||||
sub = request.values.get("sub")
|
||||
|
||||
if sub:
|
||||
sub = g.db.query(Sub.name).filter_by(name=sub.strip().lower()).one_or_none()
|
||||
|
|
|
@ -345,6 +345,10 @@ def settings_profile_post(v):
|
|||
|
||||
if house == "None": house = None
|
||||
v.house = house
|
||||
|
||||
if v.house == "Vampire":
|
||||
send_repeatable_notification(DAD_ID, f"@{v.username} has joined House Vampire!")
|
||||
|
||||
updated = True
|
||||
|
||||
quadrant = request.values.get("quadrant")
|
||||
|
|
|
@ -65,14 +65,15 @@
|
|||
{% endif %}
|
||||
|
||||
{% if not err %}
|
||||
<a class="mobile-nav-icon d-md-none" href="/random"><i class="fas fa-random align-middle text-gray-500 black"></i></a>
|
||||
<a class="mobile-nav-icon d-md-none" href="/random"><i class="fas fa-random align-middle text-gray-500 black"></i></a>
|
||||
{% if v and v.admin_level > 1 %}
|
||||
<a class="mobile-nav-icon d-md-none" href="/admin"><i class="fas fa-crown align-middle text-gray-500 black"></i></a>
|
||||
<a class="mobile-nav-icon d-md-none" href="/admin"><i class="fas fa-crown align-middle text-gray-500 black"></i></a>
|
||||
{% endif %}
|
||||
|
||||
{% if v %}
|
||||
<a class="mobile-nav-icon d-md-none" href="{% if sub %}/s/{{sub.name}}{% endif %}/submit"><i class="fas fa-feather-alt align-middle text-gray-500 black"></i></a>
|
||||
<a class="mobile-nav-icon d-md-none" href="{% if sub %}/s/{{sub.name}}{% endif %}/submit"><i class="fas fa-feather-alt align-middle text-gray-500 black"></i></a>
|
||||
{% else %}
|
||||
<a class="mobile-nav-icon d-md-none" href="/login"><i class="fas fa-feather-alt align-middle text-gray-500 black"></i></a>
|
||||
<a class="mobile-nav-icon d-md-none" href="/login"><i class="fas fa-feather-alt align-middle text-gray-500 black"></i></a>
|
||||
{% endif %}
|
||||
<button class="navbar-toggler" role="button" data-bs-toggle="collapse" data-bs-target="#navbarResponsive"
|
||||
aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
@ -2889,7 +2889,7 @@ I’m not denying it doesn’t happen, but to assume all people who wear mascot
|
|||
{[para]}
|
||||
It's the same teenager racism hate cult that MDE was all about. It's just another boring /pol/ offshoot for lonely edgelord losers.
|
||||
{[para]}
|
||||
https://rdrama.net/static/images/163933827552.webp
|
||||

|
||||
{[para]}
|
||||
I’m not insane, I just want to have some fun then curl up inside a vagina and either suffocate or be crushed by a well-trained set of pelvic floor muscles.
|
||||
{[para]}
|
||||
|
@ -2961,7 +2961,7 @@ If SRD is how you derive entertainment, then I assure you that you are, in fact,
|
|||
{[para]}
|
||||
I just went into their subreddit and they are absolutely the epitaxy of human shit, they congratulate each other for scalping and making huge profits from people who pay their prices ABSOLUTELY SICK one person brought their 27th PS5 and is happy about the profits their making from desperate people
|
||||
{[para]}
|
||||
https://rdrama.net/static/images/164115484707.webp
|
||||

|
||||
{[para]}
|
||||
i am sentient
|
||||
{[para]}
|
||||
|
@ -3105,7 +3105,7 @@ I can't fucking take it. I see an image of a random place posted and then I see
|
|||
{[para]}
|
||||
I’m a pretty solid dude, big frame, bartender, used to bounce for clubs and bars, and my favorite thing to do when I get drunk is watch the Fresh Prince and see Uncle Phil and Will and then I just cry and feel my emotions. I never had that so it resonates with me and gives me some type of release.
|
||||
{[para]}
|
||||
https://rdrama.net/static/images/164120543734.webp
|
||||

|
||||
{[para]}
|
||||
I want a virgin girlfriend just to let some random guy take her virginity before me. They will turn my once innocent girlfriend into a cock crazed slut that's getting multiple monster cocks every day and ruining her once perfect untouched pussy. Then they'll knock her up and leave the pathetic virgin loser cuck husband to take care of her. Maybe when she gets fat, old, and used up, she will say fuck it and let me fuck her and lose my virginity, but she won't even feel my pathetic little dicklet
|
||||
{[para]}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue