Skip to content

Fix too large images - #1534

Merged
ch0rizo merged 1 commit into
masterfrom
fix-large-mail-attachments
Sep 30, 2026
Merged

ch0rizo merged 1 commit into
masterfrom
fix-large-mail-attachments

Conversation

@ch0rizo

@ch0rizo ch0rizo commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes receipts that show "sendt på mail" but never reach the økans or the submitter.

Since the move to fpdf2 (#1529), HDR phone JPEGs, which Pillow reads as MPO, are embedded as raw pixels. Three ~3.5 MB photos made a ~90 MB email, far over Gmail's 25 MB limit. Gmail accepted it and then dropped it, so nobody got anything.

  • Uploads are straightened (EXIF), downscaled to max 2400 px and re-encoded as JPEG. 3 HDR photos: 91 MB → 3 MB. Sideways portrait photos are fixed too.
  • If the PDF is still over 25 MB, the user gets a clear error instead of a false success.
  • The form keeps its values on errors, so the user can remove attachments and resubmit.
  • Network errors now show a message instead of failing silently.

Result

If you've made visual changes, please check the boxes below and include images showing the changes. Descriptions are appreciated.

  • Changes look good with different viewports (mobile, tablet, etc.).
  • Changes look good with slower Internet connections.

Testing

  • I have thoroughly tested my changes.

Resolves #1533

@ch0rizo
ch0rizo requested a review from a team September 30, 2026 22:35
@ch0rizo ch0rizo self-assigned this Sep 30, 2026
@ch0rizo
ch0rizo merged commit 87d00da into master Sep 30, 2026
5 checks passed
@ch0rizo
ch0rizo deleted the fix-large-mail-attachments branch September 30, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Too large images fail to send

1 participant