From 7c83145bafa0fdcf8c0cc9ab9929e25d9314502a Mon Sep 17 00:00:00 2001 From: Llloooggg Date: Fri, 16 May 2025 03:15:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=B4=D1=81=D1=87=D0=B5?= =?UTF-8?q?=D1=82=D0=B0=20=D1=82=D0=BE=D1=82=D0=B0=D0=BB=D0=B0=20=D0=B8?= =?UTF-8?q?=D0=B7=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- image_compressor.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/image_compressor.py b/image_compressor.py index 78eac6a..6c7bab1 100644 --- a/image_compressor.py +++ b/image_compressor.py @@ -310,10 +310,9 @@ def compress_image(path: Path): if not result: result, final_path = compress_with_pillow(path) - new_size = final_path.stat().st_size - total_images_new_size += new_size - if result: + new_size = final_path.stat().st_size + total_images_new_size += new_size new_hash = file_hash(final_path) saved = original_size - new_size percent = (1 - new_size / original_size) * 100