aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar SebastiaanZ <[email protected]>2019-08-05 10:54:26 +0200
committerGravatar SebastiaanZ <[email protected]>2019-08-05 10:54:26 +0200
commit100214ce76a59128abfb81eae629f05334399533 (patch)
treef31e46c2ab16bfdeabf93a117e26536ac72b146e
parentUnify constants file quotation use (diff)
Making sure the image BytesIO buffer gets processed correctly by using an existing utility function for it
-rw-r--r--bot/seasons/evergreen/snakes/utils.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/bot/seasons/evergreen/snakes/utils.py b/bot/seasons/evergreen/snakes/utils.py
index 88fb2032..5d3b0dee 100644
--- a/bot/seasons/evergreen/snakes/utils.py
+++ b/bot/seasons/evergreen/snakes/utils.py
@@ -593,9 +593,8 @@ class SnakeAndLaddersGame:
y_offset -= BOARD_PLAYER_SIZE * math.floor(i / player_row_size)
board_img.paste(self.avatar_images[player.id],
box=(x_offset, y_offset))
- stream = io.BytesIO()
- board_img.save(stream, format='JPEG')
- board_file = File(stream.getvalue(), filename='Board.jpg')
+
+ board_file = File(frame_to_png_bytes(board_img), filename='Board.jpg')
player_list = '\n'.join((user.mention + ": Tile " + str(self.player_tiles[user.id])) for user in self.players)
# Store and send new messages