diff --git a/jarvis/cogs/image.py b/jarvis/cogs/image.py index daac58b..da8a1c3 100644 --- a/jarvis/cogs/image.py +++ b/jarvis/cogs/image.py @@ -56,7 +56,7 @@ class ImageCog(commands.Cog): await ctx.send("Image already meets target.") return - ratio = tgt_size / size + ratio = tgt_size / size - 0.05 # TODO: Optimize to not run multiple times while len(file) > tgt_size: @@ -69,6 +69,7 @@ class ImageCog(commands.Cog): new_img = cv2.resize(img, (width, height)) file = cv2.imencode(".png", new_img)[1].tobytes() + ratio = tgt_size / len(file) - 0.05 bufio = BytesIO(file) await ctx.send(