Исправление подсчета тотала изображений

This commit is contained in:
2025-05-16 03:15:05 +03:00
parent 8845367180
commit 7c83145baf

View File

@@ -310,10 +310,9 @@ def compress_image(path: Path):
if not result: if not result:
result, final_path = compress_with_pillow(path) result, final_path = compress_with_pillow(path)
if result:
new_size = final_path.stat().st_size new_size = final_path.stat().st_size
total_images_new_size += new_size total_images_new_size += new_size
if result:
new_hash = file_hash(final_path) new_hash = file_hash(final_path)
saved = original_size - new_size saved = original_size - new_size
percent = (1 - new_size / original_size) * 100 percent = (1 - new_size / original_size) * 100