Change ratio modifier to 0.02
This commit is contained in:
parent
7b64578689
commit
afb8b0617a
1 changed files with 2 additions and 2 deletions
|
@ -56,7 +56,7 @@ class ImageCog(commands.Cog):
|
||||||
await ctx.send("Image already meets target.")
|
await ctx.send("Image already meets target.")
|
||||||
return
|
return
|
||||||
|
|
||||||
ratio = tgt_size / size - 0.05
|
ratio = tgt_size / size - 0.02
|
||||||
|
|
||||||
# TODO: Optimize to not run multiple times
|
# TODO: Optimize to not run multiple times
|
||||||
while len(file) > tgt_size:
|
while len(file) > tgt_size:
|
||||||
|
@ -69,7 +69,7 @@ class ImageCog(commands.Cog):
|
||||||
|
|
||||||
new_img = cv2.resize(img, (width, height))
|
new_img = cv2.resize(img, (width, height))
|
||||||
file = cv2.imencode(".png", new_img)[1].tobytes()
|
file = cv2.imencode(".png", new_img)[1].tobytes()
|
||||||
ratio = tgt_size / len(file) - 0.05
|
ratio = tgt_size / len(file) - 0.02
|
||||||
|
|
||||||
bufio = BytesIO(file)
|
bufio = BytesIO(file)
|
||||||
await ctx.send(
|
await ctx.send(
|
||||||
|
|
Loading…
Add table
Reference in a new issue