mirror of
https://github.com/cdryzun/tg_bot_collections.git
synced 2025-04-29 00:27:09 +08:00
fix: move the img save out of loop
Signed-off-by: Frost Ming <me@frostming.com>
This commit is contained in:
parent
274e390458
commit
56a0175cc2
4
hy_tg.py
4
hy_tg.py
@ -70,9 +70,7 @@ def compress_image(input_path, output_path, target_size):
|
|||||||
(int(width * factor), int(height * factor)),
|
(int(width * factor), int(height * factor)),
|
||||||
PIL.Image.Resampling.LANCZOS,
|
PIL.Image.Resampling.LANCZOS,
|
||||||
)
|
)
|
||||||
if sizeof_image(img) <= target_bytes:
|
img.save(output_path, format="JPEG", quality=quality)
|
||||||
img.save(output_path, format="JPEG", quality=quality)
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
def draw_pretty_map(location, file_name, style):
|
def draw_pretty_map(location, file_name, style):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user