Skip to content

Commit

Permalink
Merge branch 'mealie-next' into move-faq-into-spoilers
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuchenpirat authored Jan 14, 2025
2 parents 416190b + aed93ce commit 1b0e187
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mealie/pkgs/img/minify.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from logging import Logger
from pathlib import Path

from PIL import Image
from PIL import Image, ImageOps
from pillow_heif import register_avif_opener, register_heif_opener

register_heif_opener()
Expand Down Expand Up @@ -80,6 +80,7 @@ def _convert_image(
"""

img = Image.open(image_file)
img = ImageOps.exif_transpose(img)
if img.mode not in image_format.modes:
img = img.convert(image_format.modes[0])

Expand Down Expand Up @@ -142,6 +143,7 @@ def minify(self, image_file: Path, force=True):
self._logger.info(f"{image_file.name} already minified")
else:
img = Image.open(image_file)
img = ImageOps.exif_transpose(img)
tiny_image = PillowMinifier.crop_center(img)
tiny_image.save(tiny_dest, WEBP.format, quality=70)
self._logger.info("Tiny image saved")
Expand Down

0 comments on commit 1b0e187

Please sign in to comment.