Skip to main content

embedded_preview

Function embedded_preview 

Source
pub fn embedded_preview(
    original_path: String,
    ext: String,
) -> Result<Option<FfiEmbeddedPreview>, FfiError>
Expand description

Read the embedded preview of the original at original_path, whose extension (without the dot) is ext.

None when the original is not a RAW, carries no preview, or carries one that does not read within the decode budget: each leaves the rung to the next source, so none is an error. The reason is logged.

This reads the whole original into memory, because the extraction’s IFD bounds walk and its stated-length guard run over the full file before the RAW reader does. Call it once per asset and keep the FfiEmbeddedPreview it returns, rather than once per render.

§Errors

FfiError::Workspace when the file cannot be read.