summaryrefslogtreecommitdiff
path: root/ATRI/utils/img.py
diff options
context:
space:
mode:
authorLint Action <[email protected]>2021-05-04 06:09:42 +0000
committerLint Action <[email protected]>2021-05-04 06:09:42 +0000
commit07a7e41f72cfa9dfd207a04445f4aa5b0b6fa3ce (patch)
treeb02c1b4e674acf6f56cf7335ad05acd0523af91c /ATRI/utils/img.py
parent8e94b4cd4aea1943a9639b900e33fe0fa1de5bb8 (diff)
downloadATRI-07a7e41f72cfa9dfd207a04445f4aa5b0b6fa3ce.tar.gz
ATRI-07a7e41f72cfa9dfd207a04445f4aa5b0b6fa3ce.tar.bz2
ATRI-07a7e41f72cfa9dfd207a04445f4aa5b0b6fa3ce.zip
:rotating_light: 自动进行代码格式化
Diffstat (limited to 'ATRI/utils/img.py')
-rw-r--r--ATRI/utils/img.py4
1 files changed, 2 insertions, 2 deletions
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