From e86d0ae02770d72a1ce14126dc1d4729a4c9b09f Mon Sep 17 00:00:00 2001 From: Xtao_dada Date: Sun, 20 Feb 2022 18:48:36 +0800 Subject: [PATCH] [chore] Remove White Borders from speedtest Images --- program/speedtest.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/program/speedtest.py b/program/speedtest.py index 23a56fe..9259ac4 100644 --- a/program/speedtest.py +++ b/program/speedtest.py @@ -3,6 +3,7 @@ import wget import speedtest +from PIL import Image from program.utils.formatters import bytes from driver.filters import command, other_filters from driver.decorators import sudo_users_only @@ -31,6 +32,12 @@ async def run_speedtest(_, message: Message): return m = await m.edit("🔄 sharing speedtest results") path = wget.download(result["share"]) + try: + img = Image.open(path) + c = img.crop((17, 11, 727, 389)) + c.save(path) + except: + pass output = f"""💡 **SpeedTest Results**