diff --git a/jarvis/cogs/image.py b/jarvis/cogs/image.py index ec4a459..a37c8b8 100644 --- a/jarvis/cogs/image.py +++ b/jarvis/cogs/image.py @@ -69,7 +69,7 @@ class ImageCog(commands.Cog): accuracy = 0.0 # TODO: Optimize to not run multiple times - while len(file) > tgt_size: + while len(file) > tgt_size or accuracy < 0.50: old_file = file buffer = np.frombuffer(file, dtype=np.uint8) @@ -83,7 +83,7 @@ class ImageCog(commands.Cog): accuracy = (len(file) / tgt_size) * 100 if accuracy <= 0.50: file = old_file - ratio = ratio + 0.1 + ratio += 0.1 else: ratio = tgt_size / len(file) - 0.02