{"record":{"id":"df532a51048ffb4d","repo":"openai/codex","slug":"pet-frame-dimensions-and-grid-counts-must-be-non-z","errorCode":null,"errorMessage":"pet frame dimensions and grid counts must be non-zero","messagePattern":"pet frame dimensions and grid counts must be non-zero","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/tui/src/pets/model.rs","lineNumber":333,"sourceCode":"    let (width, height) =\n        image::image_dimensions(path).with_context(|| format!(\"read {}\", path.display()))?;\n    if width != catalog::SPRITESHEET_WIDTH || height != catalog::SPRITESHEET_HEIGHT {\n        bail!(\n            \"spritesheet must be {}x{} pixels\",\n            catalog::SPRITESHEET_WIDTH,\n            catalog::SPRITESHEET_HEIGHT\n        );\n    }\n    Ok((width, height))\n}\n\nfn validate_frame_spec(\n    frame: &FrameSpec,\n    spritesheet_width: u32,\n    spritesheet_height: u32,\n) -> Result<usize> {\n    if frame.width == 0 || frame.height == 0 || frame.columns == 0 || frame.rows == 0 {\n        bail!(\"pet frame dimensions and grid counts must be non-zero\");\n    }\n\n    let total_width = frame\n        .width\n        .checked_mul(frame.columns)\n        .context(\"pet frame grid width overflow\")?;\n    let total_height = frame\n        .height\n        .checked_mul(frame.rows)\n        .context(\"pet frame grid height overflow\")?;\n    if total_width != spritesheet_width || total_height != spritesheet_height {\n        bail!(\n            \"pet frame grid must cover spritesheet exactly: expected {spritesheet_width}x{spritesheet_height}, got {total_width}x{total_height}\"\n        );\n    }\n\n    let frame_count = frame\n        .columns","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/tui/src/pets/model.rs#L315-L351","documentation":"Error \"pet frame dimensions and grid counts must be non-zero\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/tui/src/pets/model.rs:333 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}