{"abstract":"A 300 dpi scan without a YResolution prints with a stretched height.","category":"Image orientation metadata","checks":8,"contract":"Input {w, h, tag?, unit?, xres: [num, den], yres?: [num, den]}. ResolutionUnit 2 is inches (25.4 mm), 3 is centimetres (10 mm), a missing unit defaults to 2 and any other unit has no physical size (None). A missing yres equals xres; non-positive rational parts give None. For tags 5..8 the displayed width comes from the stored height at YResolution. Return displayed [width, height] in tenths of a millimetre, each rounded half up from the exact value.","contract_signature":"d","evaluation_group":"w2-image-orientation-metadata-print-physical-size","failed_approach":"Any other fixed default is still unrelated to the X resolution.","family":"w2-image-orientation-metadata-print-physical-size-yres-default","id":"FA-79216","implementations":{"attempt":{"sha256":"f2add48b25324e9d25df86ebbe9e0918705b9f566203f4dec16386cdd97661fa","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(d):\n    w, h = d['w'], d['h']\n    tag = d.get('tag', 1)\n    unit = d.get('unit', 2)\n    per = {2: Fraction(254, 10), 3: Fraction(10)}.get(unit)\n    if per is None:\n        return None\n    xn, xd = d['xres']\n    yn, yd = d.get('yres', [300, 1])\n    if xn <= 0 or xd <= 0 or yn <= 0 or yd <= 0:\n        return None\n    xr = Fraction(xn, xd)\n    yr = Fraction(yn, yd)\n    if tag in (5, 6, 7, 8):\n        w, h, xr, yr = h, w, yr, xr\n    def tenths(px, r):\n        return math.floor(px * per * 10 / r + Fraction(1, 2))\n    return [tenths(w, xr), tenths(h, yr)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[{'w': 2250, 'h': 3721, 'tag': 6, 'xres': [300, 1]}, [3150, 1905]], [{'w': 3942, 'h': 988, 'tag': 8, 'unit': 3, 'xres': [72, 1]}, [1372, 5475]], [{'w': 665, 'h': 1333, 'xres': [1000, 3]}, [507, 1016]], [{'w': 2577, 'h': 2775, 'tag': 6, 'xres': [0, 1]}, None], [{'w': 2676, 'h': 1814, 'tag': 6, 'unit': 3, 'xres': [300, 1], 'yres': [600, 1]}, [302, 892]], [{'w': 3491, 'h': 649, 'xres': [40, 1], 'yres': [1000, 3]}, [22168, 495]], [{'w': 456, 'h': 408, 'tag': 8, 'unit': 3, 'xres': [96, 1], 'yres': [96, 1]}, [425, 475]], [{'w': 2042, 'h': 678, 'unit': 3, 'xres': [150, 2]}, [2723, 904]]], [[{'w': 3188, 'h': 3159, 'tag': 1, 'unit': 2, 'xres': [1000, 3]}, [2429, 2407]], [{'w': 2100, 'h': 3201, 'unit': 2, 'xres': [40, 1]}, [13335, 20326]], [{'w': 2460, 'h': 1913, 'tag': 8, 'xres': [150, 2]}, [6479, 8331]], [{'w': 553, 'h': 1044, 'tag': 8, 'unit': 2, 'xres': [200, 3], 'yres': [-300, 1]}, None], [{'w': 2636, 'h': 3063, 'unit': 3, 'xres': [200, 3], 'yres': [300, 1]}, [3954, 1021]], [{'w': 1140, 'h': 2204, 'tag': 5, 'unit': 3, 'xres': [40, 1], 'yres': [96, 1]}, [2296, 2850]], [{'w': 3266, 'h': 1419, 'tag': 5, 'unit': 3, 'xres': [300, 1], 'yres': [1000, 3]}, [426, 1089]], [{'w': 3380, 'h': 2534, 'tag': 6, 'xres': [300, 1]}, [2145, 2862]]], [[{'w': 750, 'h': 307, 'tag': 8, 'unit': 3, 'xres': [150, 2]}, [409, 1000]], [{'w': 2235, 'h': 1712, 'tag': 8, 'unit': 3, 'xres': [40, 1]}, [4280, 5588]], [{'w': 3210, 'h': 2550, 'xres': [200, 3]}, [12230, 9716]], [{'w': 2503, 'h': 3897, 'tag': 6, 'unit': 1, 'xres': [200, 3], 'yres': [72, 1]}, None], [{'w': 724, 'h': 1179, 'unit': 2, 'xres': [40, 1], 'yres': [-300, 1]}, None], [{'w': 3823, 'h': 2286, 'tag': 8, 'unit': 3, 'xres': [150, 2], 'yres': [1000, 3]}, [686, 5097]], [{'w': 3374, 'h': 1982, 'tag': 3, 'xres': [300, 1], 'yres': [1000, 3]}, [2857, 1510]], [{'w': 1427, 'h': 2175, 'tag': 8, 'unit': 2, 'xres': [96, 1]}, [5755, 3776]]], [[{'w': 3836, 'h': 472, 'tag': 8, 'xres': [200, 3]}, [1798, 14615]], [{'w': 3053, 'h': 1173, 'unit': 3, 'xres': [96, 1]}, [3180, 1222]], [{'w': 349, 'h': 941, 'tag': 6, 'unit': 3, 'xres': [150, 2]}, [1255, 465]], [{'w': 2120, 'h': 3278, 'tag': 5, 'xres': [1000, 3], 'yres': [40, 1]}, [20815, 1615]], [{'w': 1, 'h': 3356, 'tag': 7, 'xres': [-72, 1], 'yres': [96, 1]}, None], [{'w': 3732, 'h': 1632, 'tag': 6, 'unit': 3, 'xres': [150, 2], 'yres': [72, 1]}, [2267, 4976]], [{'w': 1975, 'h': 3847, 'tag': 8, 'unit': 2, 'xres': [72, 1], 'yres': [40, 1]}, [24428, 6967]], [{'w': 2768, 'h': 3254, 'tag': 1, 'unit': 3, 'xres': [300, 1]}, [923, 1085]]], [[{'w': 3100, 'h': 22, 'tag': 6, 'unit': 3, 'xres': [96, 1]}, [23, 3229]], [{'w': 951, 'h': 3743, 'tag': 8, 'unit': 3, 'xres': [7200, 100]}, [5199, 1321]], [{'w': 3668, 'h': 2643, 'tag': 7, 'unit': 3, 'xres': [200, 3]}, [3965, 5502]], [{'w': 3914, 'h': 1446, 'tag': 3, 'unit': 2, 'xres': [7200, 100], 'yres': [1000, 3]}, [13808, 1102]], [{'w': 2880, 'h': 3333, 'tag': 1, 'xres': [200, 3], 'yres': [-300, 1]}, None], [{'w': 3908, 'h': 2121, 'tag': 6, 'unit': 1, 'xres': [96, 1], 'yres': [40, 1]}, None], [{'w': 3285, 'h': 917, 'tag': 3, 'unit': 3, 'xres': [300, 1], 'yres': [72, 1]}, [1095, 1274]], [{'w': 1800, 'h': 1611, 'tag': 6, 'xres': [1000, 3]}, [1228, 1372]]]]\nlabels = [\"regression: missing YResolution fallback\", \"repair trap\", \"combined fault\", \"control\", \"control\", \"boundary\", \"boundary\", \"control\"]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (labels[i % len(labels)], i), solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"ebc2a740d4cb326d1e2911098053802775cf071f4a23dc51e68610635e525a1d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(d):\n    w, h = d['w'], d['h']\n    tag = d.get('tag', 1)\n    unit = d.get('unit', 2)\n    per = {2: Fraction(254, 10), 3: Fraction(10)}.get(unit)\n    if per is None:\n        return None\n    xn, xd = d['xres']\n    yn, yd = d.get('yres', [72, 1])\n    if xn <= 0 or xd <= 0 or yn <= 0 or yd <= 0:\n        return None\n    xr = Fraction(xn, xd)\n    yr = Fraction(yn, yd)\n    if tag in (5, 6, 7, 8):\n        w, h, xr, yr = h, w, yr, xr\n    def tenths(px, r):\n        return math.floor(px * per * 10 / r + Fraction(1, 2))\n    return [tenths(w, xr), tenths(h, yr)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[{'w': 2250, 'h': 3721, 'tag': 6, 'xres': [300, 1]}, [3150, 1905]], [{'w': 3942, 'h': 988, 'tag': 8, 'unit': 3, 'xres': [72, 1]}, [1372, 5475]], [{'w': 665, 'h': 1333, 'xres': [1000, 3]}, [507, 1016]], [{'w': 2577, 'h': 2775, 'tag': 6, 'xres': [0, 1]}, None], [{'w': 2676, 'h': 1814, 'tag': 6, 'unit': 3, 'xres': [300, 1], 'yres': [600, 1]}, [302, 892]], [{'w': 3491, 'h': 649, 'xres': [40, 1], 'yres': [1000, 3]}, [22168, 495]], [{'w': 456, 'h': 408, 'tag': 8, 'unit': 3, 'xres': [96, 1], 'yres': [96, 1]}, [425, 475]], [{'w': 2042, 'h': 678, 'unit': 3, 'xres': [150, 2]}, [2723, 904]]], [[{'w': 3188, 'h': 3159, 'tag': 1, 'unit': 2, 'xres': [1000, 3]}, [2429, 2407]], [{'w': 2100, 'h': 3201, 'unit': 2, 'xres': [40, 1]}, [13335, 20326]], [{'w': 2460, 'h': 1913, 'tag': 8, 'xres': [150, 2]}, [6479, 8331]], [{'w': 553, 'h': 1044, 'tag': 8, 'unit': 2, 'xres': [200, 3], 'yres': [-300, 1]}, None], [{'w': 2636, 'h': 3063, 'unit': 3, 'xres': [200, 3], 'yres': [300, 1]}, [3954, 1021]], [{'w': 1140, 'h': 2204, 'tag': 5, 'unit': 3, 'xres': [40, 1], 'yres': [96, 1]}, [2296, 2850]], [{'w': 3266, 'h': 1419, 'tag': 5, 'unit': 3, 'xres': [300, 1], 'yres': [1000, 3]}, [426, 1089]], [{'w': 3380, 'h': 2534, 'tag': 6, 'xres': [300, 1]}, [2145, 2862]]], [[{'w': 750, 'h': 307, 'tag': 8, 'unit': 3, 'xres': [150, 2]}, [409, 1000]], [{'w': 2235, 'h': 1712, 'tag': 8, 'unit': 3, 'xres': [40, 1]}, [4280, 5588]], [{'w': 3210, 'h': 2550, 'xres': [200, 3]}, [12230, 9716]], [{'w': 2503, 'h': 3897, 'tag': 6, 'unit': 1, 'xres': [200, 3], 'yres': [72, 1]}, None], [{'w': 724, 'h': 1179, 'unit': 2, 'xres': [40, 1], 'yres': [-300, 1]}, None], [{'w': 3823, 'h': 2286, 'tag': 8, 'unit': 3, 'xres': [150, 2], 'yres': [1000, 3]}, [686, 5097]], [{'w': 3374, 'h': 1982, 'tag': 3, 'xres': [300, 1], 'yres': [1000, 3]}, [2857, 1510]], [{'w': 1427, 'h': 2175, 'tag': 8, 'unit': 2, 'xres': [96, 1]}, [5755, 3776]]], [[{'w': 3836, 'h': 472, 'tag': 8, 'xres': [200, 3]}, [1798, 14615]], [{'w': 3053, 'h': 1173, 'unit': 3, 'xres': [96, 1]}, [3180, 1222]], [{'w': 349, 'h': 941, 'tag': 6, 'unit': 3, 'xres': [150, 2]}, [1255, 465]], [{'w': 2120, 'h': 3278, 'tag': 5, 'xres': [1000, 3], 'yres': [40, 1]}, [20815, 1615]], [{'w': 1, 'h': 3356, 'tag': 7, 'xres': [-72, 1], 'yres': [96, 1]}, None], [{'w': 3732, 'h': 1632, 'tag': 6, 'unit': 3, 'xres': [150, 2], 'yres': [72, 1]}, [2267, 4976]], [{'w': 1975, 'h': 3847, 'tag': 8, 'unit': 2, 'xres': [72, 1], 'yres': [40, 1]}, [24428, 6967]], [{'w': 2768, 'h': 3254, 'tag': 1, 'unit': 3, 'xres': [300, 1]}, [923, 1085]]], [[{'w': 3100, 'h': 22, 'tag': 6, 'unit': 3, 'xres': [96, 1]}, [23, 3229]], [{'w': 951, 'h': 3743, 'tag': 8, 'unit': 3, 'xres': [7200, 100]}, [5199, 1321]], [{'w': 3668, 'h': 2643, 'tag': 7, 'unit': 3, 'xres': [200, 3]}, [3965, 5502]], [{'w': 3914, 'h': 1446, 'tag': 3, 'unit': 2, 'xres': [7200, 100], 'yres': [1000, 3]}, [13808, 1102]], [{'w': 2880, 'h': 3333, 'tag': 1, 'xres': [200, 3], 'yres': [-300, 1]}, None], [{'w': 3908, 'h': 2121, 'tag': 6, 'unit': 1, 'xres': [96, 1], 'yres': [40, 1]}, None], [{'w': 3285, 'h': 917, 'tag': 3, 'unit': 3, 'xres': [300, 1], 'yres': [72, 1]}, [1095, 1274]], [{'w': 1800, 'h': 1611, 'tag': 6, 'xres': [1000, 3]}, [1228, 1372]]]]\nlabels = [\"regression: missing YResolution fallback\", \"repair trap\", \"combined fault\", \"control\", \"control\", \"boundary\", \"boundary\", \"control\"]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (labels[i % len(labels)], i), solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-image-orientation-metadata-print-physical-size-yres-default","generated_at":"2026-09-29T14:49:42.485827+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"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.","root_cause":"The missing Y resolution defaults to a fixed 72 dpi instead of mirroring the X resolution.","sha256":"2e1b21cc08610ec49e168dbecbf83e245a0ab1ea41731aa196abc73cacf08417","title":"Missing YResolution falls back to 72 dpi · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":43.07,"exit_code":1,"observations":[{"actual":[3150,1905],"check":"regression: missing YResolution fallback 0","expected":[3150,1905],"passed":true},{"actual":[329,5475],"check":"repair trap 1","expected":[1372,5475],"passed":false},{"actual":[507,1129],"check":"combined fault 2","expected":[507,1016],"passed":false},{"actual":null,"check":"control 3","expected":null,"passed":true},{"actual":[302,892],"check":"control 4","expected":[302,892],"passed":true},{"actual":[22168,495],"check":"boundary 5","expected":[22168,495],"passed":true},{"actual":[425,475],"check":"boundary 6","expected":[425,475],"passed":true},{"actual":[2723,226],"check":"control 7","expected":[2723,904],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: missing YResolution fallback 0\", \"actual\": [3150, 1905], \"expected\": [3150, 1905], \"passed\": true}, {\"check\": \"repair trap 1\", \"actual\": [329, 5475], \"expected\": [1372, 5475], \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": [507, 1129], \"expected\": [507, 1016], \"passed\": false}, {\"check\": \"control 3\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 4\", \"actual\": [302, 892], \"expected\": [302, 892], \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": [22168, 495], \"expected\": [22168, 495], \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": [425, 475], \"expected\": [425, 475], \"passed\": true}, {\"check\": \"control 7\", \"actual\": [2723, 226], \"expected\": [2723, 904], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.567,"exit_code":1,"observations":[{"actual":[13127,1905],"check":"regression: missing YResolution fallback 0","expected":[3150,1905],"passed":false},{"actual":[1372,5475],"check":"repair trap 1","expected":[1372,5475],"passed":true},{"actual":[507,4703],"check":"combined fault 2","expected":[507,1016],"passed":false},{"actual":null,"check":"control 3","expected":null,"passed":true},{"actual":[302,892],"check":"control 4","expected":[302,892],"passed":true},{"actual":[22168,495],"check":"boundary 5","expected":[22168,495],"passed":true},{"actual":[425,475],"check":"boundary 6","expected":[425,475],"passed":true},{"actual":[2723,942],"check":"control 7","expected":[2723,904],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: missing YResolution fallback 0\", \"actual\": [13127, 1905], \"expected\": [3150, 1905], \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": [1372, 5475], \"expected\": [1372, 5475], \"passed\": true}, {\"check\": \"combined fault 2\", \"actual\": [507, 4703], \"expected\": [507, 1016], \"passed\": false}, {\"check\": \"control 3\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 4\", \"actual\": [302, 892], \"expected\": [302, 892], \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": [22168, 495], \"expected\": [22168, 495], \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": [425, 475], \"expected\": [425, 475], \"passed\": true}, {\"check\": \"control 7\", \"actual\": [2723, 942], \"expected\": [2723, 904], \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}