fix: move the img save out of loop

Signed-off-by: Frost Ming <me@frostming.com>
This commit is contained in:
Frost Ming 2023-12-12 11:26:44 +08:00
parent 274e390458
commit 56a0175cc2
No known key found for this signature in database
GPG Key ID: 5BFA9CB4DDA943BF

View File

@ -70,9 +70,7 @@ def compress_image(input_path, output_path, target_size):
(int(width * factor), int(height * factor)),
PIL.Image.Resampling.LANCZOS,
)
if sizeof_image(img) <= target_bytes:
img.save(output_path, format="JPEG", quality=quality)
return
def draw_pretty_map(location, file_name, style):