From 07a7e41f72cfa9dfd207a04445f4aa5b0b6fa3ce Mon Sep 17 00:00:00 2001 From: Lint Action Date: Tue, 4 May 2021 06:09:42 +0000 Subject: =?UTF-8?q?:rotating=5Flight:=20=E8=87=AA=E5=8A=A8=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ATRI/utils/img.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ATRI/utils/img.py') diff --git a/ATRI/utils/img.py b/ATRI/utils/img.py index af2c9e9..f96f368 100644 --- a/ATRI/utils/img.py +++ b/ATRI/utils/img.py @@ -9,7 +9,7 @@ def compress_image(out_file, kb=500, quality=85, k=0.9) -> str: o_size = os.path.getsize(out_file) // 1024 if o_size <= kb: return out_file - + ImageFile.LOAD_TRUNCATED_IMAGES = True # type: ignore while o_size > kb: img = Image.open(out_file) @@ -18,6 +18,6 @@ def compress_image(out_file, kb=500, quality=85, k=0.9) -> str: try: out.save(out_file, quality=quality) except WriteError: - raise WriteError('Writing file failed!') + raise WriteError("Writing file failed!") o_size = os.path.getsize(out_file) // 1024 return out_file -- cgit v1.2.3