fdgd
This commit is contained in:
parent
eefbd43e0f
commit
cdc5ddce93
2 changed files with 1 additions and 5 deletions
|
@ -21,12 +21,8 @@ def process_image(filename=None, resize=False):
|
||||||
om = next(frames)
|
om = next(frames)
|
||||||
om.info = i.info
|
om.info = i.info
|
||||||
om.save(filename, format="WEBP", save_all=True, append_images=list(frames), loop=0)
|
om.save(filename, format="WEBP", save_all=True, append_images=list(frames), loop=0)
|
||||||
sex = IImage.open(filename)
|
|
||||||
print(sex.format)
|
|
||||||
elif i.format.lower() != "webp":
|
elif i.format.lower() != "webp":
|
||||||
if i.format.lower() == "gif": gifwebp(input_image=filename, output_image=filename, option="-q 80")
|
if i.format.lower() == "gif": gifwebp(input_image=filename, output_image=filename, option="-q 80")
|
||||||
else: i.save(filename, format="WEBP")
|
else: i.save(filename, format="WEBP")
|
||||||
sex = IImage.open(filename)
|
|
||||||
print(sex.format)
|
|
||||||
|
|
||||||
return filename
|
return filename
|
|
@ -539,7 +539,7 @@ def settings_images_banner(v):
|
||||||
|
|
||||||
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}.gif'
|
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}.gif'
|
||||||
file.save(name)
|
file.save(name)
|
||||||
imageurl = DOMAIN + process_image(name)
|
imageurl = request.host_url[:-1] + process_image(name)
|
||||||
|
|
||||||
if imageurl:
|
if imageurl:
|
||||||
v.bannerurl = imageurl
|
v.bannerurl = imageurl
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue