{"record":{"id":"772b681f625e60d3","repo":"openai/codex","slug":"invalid-image-data-url-reason","errorCode":null,"errorMessage":"invalid image data URL: {reason}","messagePattern":"invalid image data URL: (.+?)","errorType":"validation","errorClass":"ImageProcessingError","httpStatus":null,"severity":"error","filePath":"codex-rs/utils/image/src/error.rs","lineNumber":28,"sourceCode":"        path: PathBuf,\n        #[source]\n        source: std::io::Error,\n    },\n    #[error(\"failed to decode image at {path}: {source}\")]\n    Decode {\n        path: PathBuf,\n        #[source]\n        source: image::ImageError,\n    },\n    #[error(\"failed to encode image as {format:?}: {source}\")]\n    Encode {\n        format: ImageFormat,\n        #[source]\n        source: image::ImageError,\n    },\n    #[error(\"unsupported image `{mime}`\")]\n    UnsupportedImageFormat { mime: String },\n    #[error(\"invalid image data URL: {reason}\")]\n    InvalidDataUrl { reason: String },\n    #[error(\"image {representation} is too large ({size} bytes; max {max} bytes)\")]\n    ImageTooLarge {\n        representation: &'static str,\n        size: usize,\n        max: usize,\n    },\n}\n\nimpl ImageProcessingError {\n    pub fn decode_error(path: &std::path::Path, source: image::ImageError) -> Self {\n        if matches!(source, ImageError::Decoding(_)) {\n            return ImageProcessingError::Decode {\n                path: path.to_path_buf(),\n                source,\n            };\n        }\n","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/utils/image/src/error.rs#L10-L46","documentation":"The InvalidDataUrl variant of ImageProcessingError: an input was presented as a data: URL but failed structural parsing (bad prefix, missing base64/body, or invalid metadata). The specific reason string identifies which check failed.","triggerScenarios":"Thrown at codex-rs/utils/image/src/error.rs:28 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-generate the data URL with a proper 'data:<mime>;base64,<payload>' shape","Pass the image as a file path or remote URL instead of a data URL","Fix the truncation or encoding issue identified by the reason string"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}