diff options
author | Lint Action <[email protected]> | 2021-05-04 06:29:07 +0000 |
---|---|---|
committer | Lint Action <[email protected]> | 2021-05-04 06:29:07 +0000 |
commit | 8804f1e10d507ba293fafc77a7e93d3a84a5814b (patch) | |
tree | e107da61f76dfe64dfb96feb5e961bbc4bbd8d52 /ATRI/utils/img.py | |
parent | ea7f48011c34fdaec7e91af7eb373c8174e439e6 (diff) | |
download | ATRI-8804f1e10d507ba293fafc77a7e93d3a84a5814b.tar.gz ATRI-8804f1e10d507ba293fafc77a7e93d3a84a5814b.tar.bz2 ATRI-8804f1e10d507ba293fafc77a7e93d3a84a5814b.zip |
:rotating_light: 自动进行代码格式化
Diffstat (limited to 'ATRI/utils/img.py')
-rw-r--r-- | ATRI/utils/img.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ATRI/utils/img.py b/ATRI/utils/img.py index b227b3d..147af79 100644 --- a/ATRI/utils/img.py +++ b/ATRI/utils/img.py @@ -9,7 +9,7 @@ def compress_image(out_file, kb=300, 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=300, 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 |