diff --git a/mealie/pkgs/img/minify.py b/mealie/pkgs/img/minify.py index 7ebe17469e4..d74724b4726 100644 --- a/mealie/pkgs/img/minify.py +++ b/mealie/pkgs/img/minify.py @@ -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() @@ -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]) @@ -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")