diff options
author | Kyomotoi <[email protected]> | 2021-01-27 21:47:58 +0800 |
---|---|---|
committer | Kyomotoi <[email protected]> | 2021-01-27 21:47:58 +0800 |
commit | eb52fab79ada7efe6191e3a5f90179766feaded0 (patch) | |
tree | ad6e513148203a6279ce8c72e9fb26fd7b415f95 /ATRI/utils.py | |
parent | b0b3a8c468b612502aea700fe59d9c885adf83dc (diff) | |
download | ATRI-eb52fab79ada7efe6191e3a5f90179766feaded0.tar.gz ATRI-eb52fab79ada7efe6191e3a5f90179766feaded0.tar.bz2 ATRI-eb52fab79ada7efe6191e3a5f90179766feaded0.zip |
[Update]
Diffstat (limited to 'ATRI/utils.py')
-rw-r--r-- | ATRI/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ATRI/utils.py b/ATRI/utils.py index 7ded644..961487c 100644 --- a/ATRI/utils.py +++ b/ATRI/utils.py @@ -51,11 +51,12 @@ def now_time() -> float: now = hour + minute / 60 return now -def compress_image(out_file: str, kb=500, quality=85, k=0.9) -> str: +def compress_image(out_file, kb=500, quality=85, k=0.9) -> str: ''' 压缩图片 :return: img file ''' + print(1) o_size = os.path.getsize(out_file) // 1024 if o_size <= kb: return out_file @@ -69,6 +70,5 @@ def compress_image(out_file: str, kb=500, quality=85, k=0.9) -> str: out.save(out_file, quality=quality) except InvalidWriteText: raise InvalidWriteText('Writing file failed!') - break o_size = os.path.getsize(out_file) // 1024 return out_file |