From 5f4c5a0b1a9c230a69b3cfc48015035a49079b0e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 1 Aug 2021 16:25:39 +0200 Subject: [PATCH] fdfd --- drama/helpers/images.py | 5 +++-- drama/routes/admin.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drama/helpers/images.py b/drama/helpers/images.py index 37e6086dff..bf640a615a 100644 --- a/drama/helpers/images.py +++ b/drama/helpers/images.py @@ -9,12 +9,13 @@ CF_ZONE = environ.get("CLOUDFLARE_ZONE").strip() imgurkey = environ.get("imgurkey").strip() -def upload_file(file=None, resize=False): +def upload_file(file=None, resize=False, png=False): if file: file.save("image.gif") if resize: - i = IImage.open("image.gif") + if png: i = IImage.open("image.png") + else: i = IImage.open("image.gif") size = 100, 100 frames = ImageSequence.Iterator(i) diff --git a/drama/routes/admin.py b/drama/routes/admin.py index a11c8e0ad3..e263b0a266 100644 --- a/drama/routes/admin.py +++ b/drama/routes/admin.py @@ -1163,7 +1163,7 @@ def multiple_plots(**kwargs): posts_chart.legend(loc='upper left', frameon=True) comments_chart.legend(loc='upper left', frameon=True) - plt.savefig("image.gif") + plt.savefig("image.png") plt.clf() - return upload_file() \ No newline at end of file + return upload_file(png=True) \ No newline at end of file