FA-79261 / Image orientation metadata / Open access
Tap mapping applies the forward tag-6 rotation instead of its inverse · case 01
Tap-to-focus on portrait photos selects a point mirrored across the diagonal.
ROOT CAUSE
The display-to-stored conversion reuses the stored-to-display formula for tag 6.
VERIFIED REPAIR
Invert the clockwise rotation: x = display y, y = h - 1 - display x.
Unsuccessful approach: Using the width as the mirror extent is the tag-8 inverse, not tag 6.
Case contract
A viewer letterboxes the displayed image (contain fit, centred) inside a view [vw, vh]. Map a tap [tx, ty] in view coordinates to the stored pixel [x, y] of an image of stored size [w, h] with orientation tag 1..8 (invalid -> 1); tags 5..8 swap displayed axes. Taps in the letterbox bars or on the far edge return None; the displayed pixel is floor of the exact position, then mapped back through the inverse of the orientation.
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.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(view, size, tag, tap):
vw, vh = view
w, h = size
tx, ty = tap
if tag not in range(1, 9):
tag = 1
dw, dh = (h, w) if tag >= 5 else (w, h)
s = min(Fraction(vw, dw), Fraction(vh, dh))
ox = (vw - dw * s) / 2
oy = (vh - dh * s) / 2
dx = (tx - ox) / s
dy = (ty - oy) / s
if dx < 0 or dy < 0 or dx >= dw or dy >= dh:
return None
px, py = math.floor(dx), math.floor(dy)
if tag == 1:
return [px, py]
if tag == 2:
return [w - 1 - px, py]
if tag == 3:
return [w - 1 - px, h - 1 - py]
if tag == 4:
return [px, h - 1 - py]
if tag == 5:
return [py, px]
if tag == 6:
return [h - 1 - py, px]
if tag == 7:
return [w - 1 - py, h - 1 - px]
return [w - 1 - py, px]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[([38, 23], [5, 8], 6, [12, 1]), [0, 5]], [([13, 35], [3, 2], 6, [12, 19]), [1, 0]], [([40, 25], [5, 4], 8, [32, 13]), None], [([35, 16], [9, 2], 5, [3, 11]), None], [([13, 34], [5, 3], 1, [10, 31]), None], [([17, 19], [3, 9], 1, [7, 11]), [0, 5]], [([13, 26], [7, 5], 8, [9, 3]), None], [([22, 27], [6, 9], 6, [18, 15]), [3, 1]]], [[([38, 27], [8, 8], 6, [10, 21]), [6, 6]], [([22, 10], [5, 9], 6, [17, 5]), [2, 1]], [([22, 28], [8, 7], 6, [5, 13]), [3, 5]], [([40, 21], [2, 9], 3, [13, 12]), None], [([25, 26], [2, 9], 6, [18, 0]), None], [([21, 19], [8, 6], 3, [19, 2]), [0, 5]], [([29, 40], [2, 5], 3, [22, 11]), [0, 3]], [([23, 36], [6, 4], 6, [14, 11]), [1, 1]]], [[([8, 30], [2, 5], 6, [7, 15]), [1, 0]], [([9, 19], [5, 6], 6, [1, 9]), [2, 5]], [([17, 38], [4, 3], 4, [2, 16]), [0, 2]], [([35, 17], [7, 6], 1, [31, 5]), None], [([22, 15], [4, 6], 7, [16, 2]), [3, 1]], [([29, 33], [4, 5], 5, [5, 29]), None], [([37, 32], [8, 3], 3, [9, 25]), None], [([15, 28], [7, 3], 6, [4, 18]), [4, 2]]], [[([36, 34], [5, 7], 6, [14, 25]), [4, 4]], [([36, 37], [6, 8], 6, [29, 28]), [5, 1]], [([22, 29], [9, 2], 3, [8, 26]), None], [([35, 16], [3, 9], 2, [10, 1]), None], [([39, 33], [9, 7], 1, [6, 23]), [1, 5]], [([20, 23], [3, 9], 0, [20, 12]), None], [([29, 39], [9, 2], 8, [0, 36]), None], [([35, 10], [4, 8], 6, [17, 8]), [3, 4]]], [[([39, 29], [4, 8], 6, [11, 19]), [2, 5]], [([15, 17], [5, 7], 6, [8, 9]), [2, 3]], [([29, 39], [7, 6], 6, [23, 25]), [4, 1]], [([29, 20], [4, 2], 6, [24, 13]), None], [([22, 31], [8, 9], 5, [14, 4]), None], [([29, 29], [7, 9], 8, [12, 2]), None], [([15, 21], [6, 7], 7, [6, 5]), [5, 4]], [([38, 33], [8, 5], 6, [29, 25]), [6, 0]]]]
labels = ["regression: inverse mapping for tag 6", "repair trap", "combined fault", "control", "control", "boundary", "boundary", "control"]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (labels[i % len(labels)], i), solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: inverse mapping for tag 6 0 | [7, 2] | [0, 5] | Failed |
| repair trap 1 | [0, 1] | [1, 0] | Failed |
| combined fault 2 | None | None | Passed |
| control 3 | None | None | Passed |
| control 4 | None | None | Passed |
| boundary 5 | [0, 5] | [0, 5] | Passed |
| boundary 6 | None | None | Passed |
| control 7 | [5, 7] | [3, 1] | Failed |
SHA-256 / 7e74c106633bf5e1ba68de73e4f51a9225fc6df7f4fc45009773137a59d56bbd
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(view, size, tag, tap):
vw, vh = view
w, h = size
tx, ty = tap
if tag not in range(1, 9):
tag = 1
dw, dh = (h, w) if tag >= 5 else (w, h)
s = min(Fraction(vw, dw), Fraction(vh, dh))
ox = (vw - dw * s) / 2
oy = (vh - dh * s) / 2
dx = (tx - ox) / s
dy = (ty - oy) / s
if dx < 0 or dy < 0 or dx >= dw or dy >= dh:
return None
px, py = math.floor(dx), math.floor(dy)
if tag == 1:
return [px, py]
if tag == 2:
return [w - 1 - px, py]
if tag == 3:
return [w - 1 - px, h - 1 - py]
if tag == 4:
return [px, h - 1 - py]
if tag == 5:
return [py, px]
if tag == 6:
return [py, w - 1 - px]
if tag == 7:
return [w - 1 - py, h - 1 - px]
return [w - 1 - py, px]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[([38, 23], [5, 8], 6, [12, 1]), [0, 5]], [([13, 35], [3, 2], 6, [12, 19]), [1, 0]], [([40, 25], [5, 4], 8, [32, 13]), None], [([35, 16], [9, 2], 5, [3, 11]), None], [([13, 34], [5, 3], 1, [10, 31]), None], [([17, 19], [3, 9], 1, [7, 11]), [0, 5]], [([13, 26], [7, 5], 8, [9, 3]), None], [([22, 27], [6, 9], 6, [18, 15]), [3, 1]]], [[([38, 27], [8, 8], 6, [10, 21]), [6, 6]], [([22, 10], [5, 9], 6, [17, 5]), [2, 1]], [([22, 28], [8, 7], 6, [5, 13]), [3, 5]], [([40, 21], [2, 9], 3, [13, 12]), None], [([25, 26], [2, 9], 6, [18, 0]), None], [([21, 19], [8, 6], 3, [19, 2]), [0, 5]], [([29, 40], [2, 5], 3, [22, 11]), [0, 3]], [([23, 36], [6, 4], 6, [14, 11]), [1, 1]]], [[([8, 30], [2, 5], 6, [7, 15]), [1, 0]], [([9, 19], [5, 6], 6, [1, 9]), [2, 5]], [([17, 38], [4, 3], 4, [2, 16]), [0, 2]], [([35, 17], [7, 6], 1, [31, 5]), None], [([22, 15], [4, 6], 7, [16, 2]), [3, 1]], [([29, 33], [4, 5], 5, [5, 29]), None], [([37, 32], [8, 3], 3, [9, 25]), None], [([15, 28], [7, 3], 6, [4, 18]), [4, 2]]], [[([36, 34], [5, 7], 6, [14, 25]), [4, 4]], [([36, 37], [6, 8], 6, [29, 28]), [5, 1]], [([22, 29], [9, 2], 3, [8, 26]), None], [([35, 16], [3, 9], 2, [10, 1]), None], [([39, 33], [9, 7], 1, [6, 23]), [1, 5]], [([20, 23], [3, 9], 0, [20, 12]), None], [([29, 39], [9, 2], 8, [0, 36]), None], [([35, 10], [4, 8], 6, [17, 8]), [3, 4]]], [[([39, 29], [4, 8], 6, [11, 19]), [2, 5]], [([15, 17], [5, 7], 6, [8, 9]), [2, 3]], [([29, 39], [7, 6], 6, [23, 25]), [4, 1]], [([29, 20], [4, 2], 6, [24, 13]), None], [([22, 31], [8, 9], 5, [14, 4]), None], [([29, 29], [7, 9], 8, [12, 2]), None], [([15, 21], [6, 7], 7, [6, 5]), [5, 4]], [([38, 33], [8, 5], 6, [29, 25]), [6, 0]]]]
labels = ["regression: inverse mapping for tag 6", "repair trap", "combined fault", "control", "control", "boundary", "boundary", "control"]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (labels[i % len(labels)], i), solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: inverse mapping for tag 6 0 | [0, 2] | [0, 5] | Failed |
| repair trap 1 | [1, 1] | [1, 0] | Failed |
| combined fault 2 | None | None | Passed |
| control 3 | None | None | Passed |
| control 4 | None | None | Passed |
| boundary 5 | [0, 5] | [0, 5] | Passed |
| boundary 6 | None | None | Passed |
| control 7 | [3, -2] | [3, 1] | Failed |
SHA-256 / 8a7e66f3294a5694096a294d84e6a1cbe28bf72f3b2ad362d5b1e5c70328d7ab
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(view, size, tag, tap):
vw, vh = view
w, h = size
tx, ty = tap
if tag not in range(1, 9):
tag = 1
dw, dh = (h, w) if tag >= 5 else (w, h)
s = min(Fraction(vw, dw), Fraction(vh, dh))
ox = (vw - dw * s) / 2
oy = (vh - dh * s) / 2
dx = (tx - ox) / s
dy = (ty - oy) / s
if dx < 0 or dy < 0 or dx >= dw or dy >= dh:
return None
px, py = math.floor(dx), math.floor(dy)
if tag == 1:
return [px, py]
if tag == 2:
return [w - 1 - px, py]
if tag == 3:
return [w - 1 - px, h - 1 - py]
if tag == 4:
return [px, h - 1 - py]
if tag == 5:
return [py, px]
if tag == 6:
return [py, h - 1 - px]
if tag == 7:
return [w - 1 - py, h - 1 - px]
return [w - 1 - py, px]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[([38, 23], [5, 8], 6, [12, 1]), [0, 5]], [([13, 35], [3, 2], 6, [12, 19]), [1, 0]], [([40, 25], [5, 4], 8, [32, 13]), None], [([35, 16], [9, 2], 5, [3, 11]), None], [([13, 34], [5, 3], 1, [10, 31]), None], [([17, 19], [3, 9], 1, [7, 11]), [0, 5]], [([13, 26], [7, 5], 8, [9, 3]), None], [([22, 27], [6, 9], 6, [18, 15]), [3, 1]]], [[([38, 27], [8, 8], 6, [10, 21]), [6, 6]], [([22, 10], [5, 9], 6, [17, 5]), [2, 1]], [([22, 28], [8, 7], 6, [5, 13]), [3, 5]], [([40, 21], [2, 9], 3, [13, 12]), None], [([25, 26], [2, 9], 6, [18, 0]), None], [([21, 19], [8, 6], 3, [19, 2]), [0, 5]], [([29, 40], [2, 5], 3, [22, 11]), [0, 3]], [([23, 36], [6, 4], 6, [14, 11]), [1, 1]]], [[([8, 30], [2, 5], 6, [7, 15]), [1, 0]], [([9, 19], [5, 6], 6, [1, 9]), [2, 5]], [([17, 38], [4, 3], 4, [2, 16]), [0, 2]], [([35, 17], [7, 6], 1, [31, 5]), None], [([22, 15], [4, 6], 7, [16, 2]), [3, 1]], [([29, 33], [4, 5], 5, [5, 29]), None], [([37, 32], [8, 3], 3, [9, 25]), None], [([15, 28], [7, 3], 6, [4, 18]), [4, 2]]], [[([36, 34], [5, 7], 6, [14, 25]), [4, 4]], [([36, 37], [6, 8], 6, [29, 28]), [5, 1]], [([22, 29], [9, 2], 3, [8, 26]), None], [([35, 16], [3, 9], 2, [10, 1]), None], [([39, 33], [9, 7], 1, [6, 23]), [1, 5]], [([20, 23], [3, 9], 0, [20, 12]), None], [([29, 39], [9, 2], 8, [0, 36]), None], [([35, 10], [4, 8], 6, [17, 8]), [3, 4]]], [[([39, 29], [4, 8], 6, [11, 19]), [2, 5]], [([15, 17], [5, 7], 6, [8, 9]), [2, 3]], [([29, 39], [7, 6], 6, [23, 25]), [4, 1]], [([29, 20], [4, 2], 6, [24, 13]), None], [([22, 31], [8, 9], 5, [14, 4]), None], [([29, 29], [7, 9], 8, [12, 2]), None], [([15, 21], [6, 7], 7, [6, 5]), [5, 4]], [([38, 33], [8, 5], 6, [29, 25]), [6, 0]]]]
labels = ["regression: inverse mapping for tag 6", "repair trap", "combined fault", "control", "control", "boundary", "boundary", "control"]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (labels[i % len(labels)], i), solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: inverse mapping for tag 6 0 | [0, 5] | [0, 5] | Passed |
| repair trap 1 | [1, 0] | [1, 0] | Passed |
| combined fault 2 | None | None | Passed |
| control 3 | None | None | Passed |
| control 4 | None | None | Passed |
| boundary 5 | [0, 5] | [0, 5] | Passed |
| boundary 6 | None | None | Passed |
| control 7 | [3, 1] | [3, 1] | Passed |
SHA-256 / 77deb3127e7778c28a757901abb898c0764ef52728786287260acb2b36173574
Verification & scope
A deterministic bounded teaching model with a stipulated contract; it makes no claim of conformance to any published specification. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:49:43.046152+00:00.
Case digest / 9a41543783b40dfa7694ee034fe810af5ab7fad0aef9f437a8526f699af0d821