serve: phone photos reach the model rotated by 90° (EXIF Orientation is ignored)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start in serve/server.py at Vision.normalize(), where JPEGs currently pass through byte for byte. Read the attached strata-exif-orientation.patch to see the intended change: detect EXIF Orientation ≠ 1 and route those JPEGs through Pillow's ImageOps.exif_transpose() and PNG encoding like other formats, keeping a no-Pillow fallback. Verify by building a 40×20 JPEG with Orientation=6 (expect 20×40 output) and one without the tag (expect byte-identical passthrough), then confirm PNG/BMP/GIF are untouched.
Written by the indexing model from the issue text.
Description
Problem. Most phones save a portrait photo as a landscape JPEG and only set the EXIF tag Orientation (6 or 8). Vision.normalize() in serve/server.py passes JPEGs through unchanged, and strata-vision's decoder (stb_image) ignores EXIF. So the model sees the photo turned sideways. In OpenWebUI the model told me several times that my images were rotated by 90°, and it was right.
Fix. The fix is a small patch to serve/server.py, attached as strata-exif-orientation.patch. It applies to current main with git apply.
- A JPEG with an EXIF
Orientationother than 1 no longer passes through. It goes the Pillow route instead:ImageOps.exif_transpose(), then PNG, as other formats already do. - JPEGs without the tag, and PNG, BMP and GIF, are unchanged and still pass through byte for byte.
- Without Pillow,
_exif_rotated()returns False, so the behaviour stays as today.
Checked.
- A 40×20 test JPEG with
Orientation = 6comes out as a 20×40 PNG. - The same JPEG without the tag comes out byte-identical to the input.
- It runs live on my server: 2× TITAN RTX, UD-Q4_K_XL, images through OpenWebUI.
Written by my agent, tested on my machine.
- Dominant language
- C++
- Stars
- 11.6k
- Forks
- 1k
- Avg merge
- 7h 46m
- Merged PRs (30d)
- 30
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Niko1221/Strata
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Niko1221/Strata#1248 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
bug iOS 🍎 ui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
MerginMaps/mobile#4744 ·
Maintainers usually reply within 1 day
-
Component: Ruby Type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
kokkos/kokkos-kernels#3328 ·
Maintainers usually reply within 1 day
-
bug needs triage tcp
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
project-chip/connectedhomeip#74644 ·
Maintainers usually reply within 1 day