From 6db0132b0777cb9d7ccdc393b9c45f11dec0034c Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Sat, 26 Jun 2021 23:27:48 -0600 Subject: [PATCH] Fix loop to account for accuracy (for real this time) --- jarvis/cogs/image.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)