diff --git a/app/utils/pdf_export.py b/app/utils/pdf_export.py index 01e09c2..e0624cc 100644 --- a/app/utils/pdf_export.py +++ b/app/utils/pdf_export.py @@ -121,8 +121,12 @@ def _compress_image(src_path: str) -> io.BytesIO | None: if not _PIL_AVAILABLE: return None try: + from PIL import ImageOps img = PILImage.open(src_path) + # Apply EXIF orientation tag so rotated phone photos appear upright. + img = ImageOps.exif_transpose(img) + # Strip transparency — JPEG does not support alpha channels. # Convert palette / RGBA / LA → RGB before saving. if img.mode in ('RGBA', 'LA', 'P'):