openai/codex · error · ImageProcessingError

unsupported image `{mime}`

Error message

unsupported image `{mime}`

What it means

Error "unsupported image `{mime}`" thrown in openai/codex.

Source

Thrown at codex-rs/utils/image/src/error.rs:26

    #[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,
        size: usize,
        max: usize,
    },
}

impl ImageProcessingError {
    pub fn decode_error(path: &std::path::Path, source: image::ImageError) -> Self {
        if matches!(source, ImageError::Decoding(_)) {
            return ImageProcessingError::Decode {
                path: path.to_path_buf(),
                source,
            };

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/utils/image/src/error.rs:26 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/e7a416130e8b12cf. Report an issue: GitHub.