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']:
|
if tempname.split('.')[-1] in ['jpg', 'jpeg']:
|
||||||
piexif.remove(tempname)
|
piexif.remove(tempname)
|
||||||
|
|
||||||
upload_file(tempname,
|
imagurl = upload_file(tempname, tempname, (50, 50))
|
||||||
Key=name,
|
|
||||||
ExtraArgs={'ACL': 'public-read',
|
|
||||||
"ContentType": "image/png",
|
|
||||||
"StorageClass": "INTELLIGENT_TIERING"
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
remove(tempname)
|
remove(tempname)
|
||||||
|
|
||||||
|
return imageurl
|
||||||
|
|
||||||
def crop_and_resize(img, resize):
|
def crop_and_resize(img, resize):
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,18 @@ import matplotlib.pyplot as plt
|
||||||
from .front import frontlist
|
from .front import frontlist
|
||||||
from ruqqus.__main__ import app, cache
|
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"])
|
@app.route("/admin/shadowbanned", methods=["GET"])
|
||||||
@auth_required
|
@auth_required
|
||||||
def shadowbanned(v):
|
def shadowbanned(v):
|
||||||
|
|
|
@ -375,7 +375,7 @@ def thumbs(new_post):
|
||||||
for chunk in image_req.iter_content(1024):
|
for chunk in image_req.iter_content(1024):
|
||||||
file.write(chunk)
|
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
|
if post.thumburl: post.has_thumb = True
|
||||||
g.db.add(post)
|
g.db.add(post)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue