openai/codex · error · anyhow::Error

pet frame dimensions and grid counts must be non-zero

Error message

pet frame dimensions and grid counts must be non-zero

What it means

Error "pet frame dimensions and grid counts must be non-zero" thrown in openai/codex.

Source

Thrown at codex-rs/tui/src/pets/model.rs:333

    let (width, height) =
        image::image_dimensions(path).with_context(|| format!("read {}", path.display()))?;
    if width != catalog::SPRITESHEET_WIDTH || height != catalog::SPRITESHEET_HEIGHT {
        bail!(
            "spritesheet must be {}x{} pixels",
            catalog::SPRITESHEET_WIDTH,
            catalog::SPRITESHEET_HEIGHT
        );
    }
    Ok((width, height))
}

fn validate_frame_spec(
    frame: &FrameSpec,
    spritesheet_width: u32,
    spritesheet_height: u32,
) -> Result<usize> {
    if frame.width == 0 || frame.height == 0 || frame.columns == 0 || frame.rows == 0 {
        bail!("pet frame dimensions and grid counts must be non-zero");
    }

    let total_width = frame
        .width
        .checked_mul(frame.columns)
        .context("pet frame grid width overflow")?;
    let total_height = frame
        .height
        .checked_mul(frame.rows)
        .context("pet frame grid height overflow")?;
    if total_width != spritesheet_width || total_height != spritesheet_height {
        bail!(
            "pet frame grid must cover spritesheet exactly: expected {spritesheet_width}x{spritesheet_height}, got {total_width}x{total_height}"
        );
    }

    let frame_count = frame
        .columns

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/tui/src/pets/model.rs:333 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/df532a51048ffb4d. Report an issue: GitHub.