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