Fix loop to account for accuracy (for real this time)

This commit is contained in:
Zeva Rose 2021-06-26 23:27:48 -06:00
parent 04d2d6ef55
commit 6db0132b07

View file

@ -69,7 +69,9 @@ class ImageCog(commands.Cog):
accuracy = 0.0 accuracy = 0.0
# TODO: Optimize to not run multiple times # 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 old_file = file
buffer = np.frombuffer(file, dtype=np.uint8) buffer = np.frombuffer(file, dtype=np.uint8)