sneed
This commit is contained in:
parent
0a4693c790
commit
dd232eb9d2
3 changed files with 15 additions and 8 deletions
|
@ -43,16 +43,11 @@ def upload_from_url(name, url):
|
|||
if tempname.split('.')[-1] in ['jpg', 'jpeg']:
|
||||
piexif.remove(tempname)
|
||||
|
||||
upload_file(tempname,
|
||||
Key=name,
|
||||
ExtraArgs={'ACL': 'public-read',
|
||||
"ContentType": "image/png",
|
||||
"StorageClass": "INTELLIGENT_TIERING"
|
||||
}
|
||||
)
|
||||
imagurl = upload_file(tempname, tempname, (50, 50))
|
||||
|
||||
remove(tempname)
|
||||
|
||||
return imageurl
|
||||
|
||||
def crop_and_resize(img, resize):
|
||||
|
||||
|
|
|
@ -24,6 +24,18 @@ import matplotlib.pyplot as plt
|
|||
from .front import frontlist
|
||||
from ruqqus.__main__ import app, cache
|
||||
|
||||
|
||||
@app.route("/admin/resize", methods=["GET"])
|
||||
@auth_required
|
||||
def shadowbanned(v):
|
||||
if not (v and v.admin_level == 6): abort(404)
|
||||
for u in g.db.query(User).filter(User.profileurl != None).all():
|
||||
u.profileurl = upload_from_url(u.username, u.profileurl)
|
||||
g.db.add(u)
|
||||
print(u.profileurl)
|
||||
return "sex"
|
||||
|
||||
|
||||
@app.route("/admin/shadowbanned", methods=["GET"])
|
||||
@auth_required
|
||||
def shadowbanned(v):
|
||||
|
|
|
@ -375,7 +375,7 @@ def thumbs(new_post):
|
|||
for chunk in image_req.iter_content(1024):
|
||||
file.write(chunk)
|
||||
|
||||
post.thumburl = upload_from_file(name, tempname, resize=(150, 100))
|
||||
post.thumburl = upload_from_file(name, tempname, resize=(50, 50))
|
||||
if post.thumburl: post.has_thumb = True
|
||||
g.db.add(post)
|
||||
g.db.commit()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue