Improved compression

This commit is contained in:
Profitroll
2022-12-20 22:52:05 +01:00
parent 4892916e16
commit 5a139c075c
2 changed files with 10 additions and 1 deletions

View File

@@ -29,8 +29,10 @@ async def compress_image(image_path: str):
size_before = path.getsize(image_path) / 1024
system(f"exiftool -overwrite_original -all:all= -tagsFromFile @ -exif:Orientation {image_path}")
if image_type == "image/jpeg":
system(f"jpegoptim {image_path} -o --max=60 --strip-all")
system(f"jpegoptim {image_path} -o --max=55 -p")
elif image_type == "image/png":
system(f"optipng -o3 {image_path}")