fix(fuse): turn generated thumbnails the way their EXIF orientation says

Thumbnails were decoded without the EXIF orientation, so a portrait photo
stored as landscape pixels plus a tag got a sideways tile, and the drain
uploaded that thumbnail to Drive for every client to show (B226).
This commit is contained in:
nvrl committed 2026-10-16 10:32:05 +02:00
1 parent 96b70600f0
commit 607972cf1e
2 files changed
+91 -5

No files matched your search

+22
View File
@@ -100,6 +100,7 @@ a live account since.
| Entry | Title |
|---|---|
| [B226](#b226--thumbnails-of-portrait-phone-photos-lie-on-their-side) | Thumbnails of portrait phone photos lie on their side |
| [B225](#b225--a-takeout-photo-without-a-sidecar-takes-a-siblings-name-and-date) | A Takeout photo without a sidecar takes a sibling's name and date |
| [B223](#b223--a-damaged-config-file-is-replaced-with-defaults-on-the-next-settings-change) | A damaged config file is replaced with defaults on the next settings change |
| [B224](#b224--fallocate-zero-ranges-are-undone-and-collapse-ranges-corrupt-the-file) | `fallocate` zero ranges are undone and collapse ranges corrupt the file |
@@ -328,6 +329,27 @@ a live account since.
Newest first.
### B226 — Thumbnails of portrait phone photos lie on their side
**Status:** Fixed, not verified live
**Found:** 2026-10-16, architecture audit (`FINDINGS.md` 2.4.4).
**Where:** `decode_upright` and `scale_thumbnail_with_exiftool` in
`crates/pdfs-fuse/src/photos.rs`
**Repro:** Upload a portrait photo taken with a phone that stores landscape pixels plus an EXIF
orientation tag, which most do. Its tile in the app, and in Proton's own apps, lies on its side.
**Cause.** Generated thumbnails were decoded with `ImageReader::decode`, which ignores the EXIF
orientation. Only the RAW preview path applied it. The drain uploads the generated thumbnail with
the photo, so every client showed it sideways.
**Fix.** `decode_upright` reads the orientation from the decoder and applies it before the image
is scaled.
**Test:** `photos::tests::a_thumbnail_is_turned_the_way_its_exif_says`.
---
### B225 — A Takeout photo without a sidecar takes a sibling's name and date
**Status:** Fixed, not verified live