FA-79098 / Image orientation metadata / Member archive
Front camera rotation adds the device turn like the back camera · case 03
Landscape selfies are saved upside down.
Case contract
Input [gx, gy, previous_rotation, camera] with gravity in milli-g in the portrait device frame (x right, y down). Device rotation: keep the previous bucket when the in-plane magnitude is below 300 mg or |gx| == |gy| (hysteresis); otherwise gy dominates -> 0 (gy > 0) or 180, gx dominates -> 90 (gx > 0) or 270. The back sensor is mounted at 90 degrees and needs (90 + r) mod 360 clockwise; the mirrored front sensor is mounted at 270 and needs (270 - r) mod 360 with the mirror bit. The tag comes from (quarter turns, mirror) via 1:(0,0) 2:(0,1) 3:(2,0) 4:(2,1) 5:(3,1) 6:(1,0) 7:(1,1) 8:(3,0). Return [tag, r].
Why this case matters
Camera, phone and scanner images carry an orientation hint separately from the stored pixels; galleries, thumbnailers, editors and upload pipelines must interpret it consistently or photos appear sideways, mirrored or doubly rotated.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: front sensor rotation direction 0 | [4, 270] | [2, 270] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗