Add accuracy line to image return
This commit is contained in:
parent
31d554e2d2
commit
2c7380e502
1 changed files with 3 additions and 1 deletions
|
@ -72,8 +72,10 @@ class ImageCog(commands.Cog):
|
||||||
ratio = tgt_size / len(file) - 0.02
|
ratio = tgt_size / len(file) - 0.02
|
||||||
|
|
||||||
bufio = BytesIO(file)
|
bufio = BytesIO(file)
|
||||||
|
accuracy = (len(file) / tgt_size) * 100
|
||||||
await ctx.send(
|
await ctx.send(
|
||||||
"New size: {}".format(convert_bytesize(len(file))),
|
"New size: {}".format(convert_bytesize(len(file)))
|
||||||
|
+ "\nAccuracy: {}".format(accuracy),
|
||||||
file=File(bufio, filename="resized.png"),
|
file=File(bufio, filename="resized.png"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue