{"record":{"id":"7095b7f1dc025d5d","repo":"pbakaus/impeccable","slug":"embed-prompt-no-embedded-prompt-found","errorCode":null,"errorMessage":"embed-prompt: no embedded prompt found\n","messagePattern":"embed-prompt: no embedded prompt found\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/context/src/embed_prompt.rs","lineNumber":253,"sourceCode":"    }\n\n    let Some(file) = file.filter(|f| exists(&abs(f))) else {\n        io.err(\"embed-prompt: image file required\\n\");\n        return 1;\n    };\n    let file_abs = abs(&file);\n    let buf = std::fs::read(&file_abs).unwrap_or_default();\n    let ty = image_type(&buf);\n    let png = ty == Some(ImageType::Png);\n    let jpeg = ty == Some(ImageType::Jpeg);\n    let sidecar = format!(\"{}.json\", file);\n    let sidecar_abs = format!(\"{}.json\", file_abs);\n\n    if read_mode {\n        let prompt = read_prompt(&file_abs, &buf);\n        match prompt {\n            None => {\n                io.err(\"embed-prompt: no embedded prompt found\\n\");\n                2\n            }\n            Some(p) => {\n                io.out(&format!(\"{}\\n\", p));\n                0\n            }\n        }\n    } else {\n        let prompt = match arg_of(\"--prompt\") {\n            Some(p) => Some(p),\n            None => match arg_of(\"--prompt-file\") {\n                Some(pf) if !pf.is_empty() => match std::fs::read(abs(&pf)) {\n                    Ok(b) => Some(String::from_utf8_lossy(&b).into_owned()),\n                    Err(e) => {\n                        io.err(&format!(\"Error: {}\\n\", crate::util::node_read_error(&pf, &e)));\n                        return 1;\n                    }\n                },","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/pbakaus/impeccable/blob/2bc2879276c1f321a53c4ca99d3371e411329b52/crates/context/src/embed_prompt.rs#L235-L271","documentation":"In read mode (`embed-prompt --read` or similar), the CLI attempts to extract an embedded generation prompt from the image (PNG tEXt chunk or JPEG COM segment). If neither container carries the keyword-marked prompt, it prints this and exits with code 2.","triggerScenarios":"Running read mode on an image that was never processed by embed-prompt, an image whose embedded prompt was stripped by an optimizer/re-encoder, or a non-PNG/non-JPEG file.","commonSituations":"Images passed through image optimizers (e.g. squash/recompress tools) that drop ancillary chunks, screenshots of generated images, or hand-authored assets that never had a prompt embedded.","solutions":["Regenerate or re-embed the prompt: run `embed-prompt --image <file> --prompt <p>` in write mode first.","Check the image did not pass through an optimizer that strips PNG tEXt or JPEG COM segments.","Keep the original engine-output image (with embedded prompt) alongside optimized variants."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// nothing static to check; presence of embedded metadata is only knowable after read","typeGuard":null,"tryCatchPattern":"const p = readEmbeddedPrompt(img); if (p == null) { console.warn('no embedded prompt; using sidecar fallback'); p = readSidecar(img); }","preventionTips":["Keep originals with embedded prompts alongside optimized copies","Avoid routing embedded images through optimizers that strip tEXt/COM segments","Store a .json sidecar as a fallback prompt source"],"tags":["cli","metadata","png","jpeg"],"backgroundTag":"resource-not-found","analyzedSha":"2bc2879276c1f321a53c4ca99d3371e411329b52","analyzedAt":"2026-09-08T04:51:14.109Z","contentChangedAt":"2026-09-08T04:51:14.109Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}