openai/codex · error · ImageProcessingError
failed to decode image at
Error message
failed to decode image at {path}: {source} What it means
ImageProcessingError::Decode variant: the image file was read but the image crate could not decode its contents at the given path (corrupt data, unsupported format, or truncated file); the ImageError is attached via #[source].
Solutions
- Verify the file is a complete, valid image in a supported format
- Re-export or re-download the image
- Detect the actual format from content instead of trusting the extension
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at codex-rs/utils/image/src/error.rs:14 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/256b069d8586ff79.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/utils/image/src/error.rs:14
use image::ImageError;
use image::ImageFormat;
use std::path::PathBuf;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum ImageProcessingError {
#[error("failed to read image at {path}: {source}")]
Read {
path: PathBuf,
#[source]
source: std::io::Error,
},
#[error("failed to decode image at {path}: {source}")]
Decode {
path: PathBuf,
#[source]
source: image::ImageError,
},
#[error("failed to encode image as {format:?}: {source}")]
Encode {
format: ImageFormat,
#[source]
source: image::ImageError,
},
#[error("unsupported image `{mime}`")]
UnsupportedImageFormat { mime: String },
#[error("invalid image data URL: {reason}")]
InvalidDataUrl { reason: String },
#[error("image {representation} is too large ({size} bytes; max {max} bytes)")]
ImageTooLarge {
representation: &'static str,View on GitHub (pinned to 339751715c)