FA-79004 / Image orientation metadata / Member archive
HEIF images are rotated by their EXIF copy · case 04
HEIC photos with both EXIF and irot are rotated twice or not at all depending on the camera.
Case contract
Resolve the displayed orientation tag from metadata sources. For HEIF, the container transforms are authoritative and EXIF/XMP are ignored: irot is anticlockwise quarter turns (default 0) applied first, then imir mirrors about the vertical axis (0, left-right) or the horizontal axis (1, top-bottom); the result is mapped to a tag through (k clockwise quarter turns after m mirrors) = {(0,0):1, (0,1):2, (2,0):3, (2,1):4, (3,1):5, (1,0):6, (1,1):7, (3,0):8}. For other containers a valid integer EXIF value 1..8 wins; otherwise an XMP string that is a single digit 1..8 after trimming whitespace; otherwise 1.
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: HEIF container authority 0 | 1 | 5 | 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 ↗