{"record":{"id":"691dd7d5f66c50e4","repo":"Hmbown/CodeWhale","slug":"unexpected-founder-sheet-geometry-image-size","errorCode":null,"errorMessage":"unexpected founder sheet geometry: {image.size}","messagePattern":"unexpected founder sheet geometry: (.+?)","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"scripts/brand/braille-mark.py","lineNumber":77,"sourceCode":"    (1, 1): 0x10,\n    (2, 1): 0x20,\n    (3, 0): 0x40,\n    (3, 1): 0x80,\n}\n\n\ndef is_navy(pixel: tuple[int, int, int]) -> bool:\n    r, g, b = pixel\n    return b > 60 and b > r + 25 and r < 110 and g < 150\n\n\ndef load_sheet() -> Image.Image:\n    if not RASTER.exists():\n        raise SystemExit(f\"founder raster missing: {RASTER}\")\n    image = Image.open(RASTER).convert(\"RGB\")\n    width, height = image.size\n    if width != height or width < 800:\n        raise SystemExit(f\"unexpected founder sheet geometry: {image.size}\")\n    return image\n\n\ndef band_box(image: Image.Image, band: tuple[float, float, float, float]):\n    width, height = image.size\n    return (\n        int(band[0] * width),\n        int(band[1] * width),\n        int(band[2] * height),\n        int(band[3] * height),\n    )\n\n\ndef hero_coverage(image: Image.Image) -> tuple[int, int, list[list[float]]]:\n    \"\"\"Navy-darkness coverage of the hero whale crop, each in 0..1.\"\"\"\n    width, height = image.size\n    x0, x1, y0, _ = band_box(image, HERO_BAND)\n    pixels = image.load()","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/brand/braille-mark.py#L59-L95","documentation":"After loading the founder sheet, `load_sheet()` validates geometry: the image must be square (`width == height`) and at least 800px wide. This SystemExit fires when the raster has unexpected dimensions, since the fractional search bands and hero detection assume the sheet layout.","triggerScenarios":"`load_sheet()` (called by `write_png`/`main`) opens a `brand/codewhalemarkfinal.png` whose width != height or whose width < 800 pixels at scripts/brand/braille-mark.py:77.","commonSituations":"A placeholder, thumbnail, or re-exported crop replaced the original sheet; git-lfs pointers fetched at reduced size; someone replaced the raster with a differently sized variant; downloading a preview image instead of the full asset.","solutions":["Check the actual dimensions with `python -c \"from PIL import Image; print(Image.open('brand/codewhalemarkfinal.png').size)\"`","Restore the original square founder sheet (>=800x800) from git history or the design source","Re-export the raster at full square resolution and overwrite brand/codewhalemarkfinal.png","If git-lfs is in use, confirm the real binary was fetched, not a small pointer/preview"],"exampleFix":"# before\nImage.open('brand/codewhalemarkfinal.png').size  # (512, 640)\n# after: replace with the square sheet\nImage.open('brand/codewhalemarkfinal.png').size  # (2048, 2048)","handlingStrategy":"validation","validationCode":"from PIL import Image\nw, h = Image.open(\"brand/codewhalemarkfinal.png\").size\nassert w == h and w >= 800, f\"sheet must be square and >=800px, got {(w, h)}\"","typeGuard":null,"tryCatchPattern":"try:\n    main()\nexcept SystemExit as e:\n    if \"unexpected founder sheet geometry\" in str(e):\n        raise SystemExit(\"restore the original square founder sheet (>=800px) from design source\")","preventionTips":["Never replace the raster with cropped/preview exports","Confirm LFS pulled the full binary, not a downscaled variant","Check image dimensions before committing raster changes","Keep the sheet square per the script's layout assumptions"],"tags":["python","validation","image-geometry","branding-script"],"backgroundTag":"invalid-config-value","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}