Trait c2pa::IngredientOptions
source · pub trait IngredientOptions {
// Provided methods
fn title(&self, _path: &Path) -> Option<String> { ... }
fn hash(&self, _path: &Path) -> Option<String> { ... }
fn thumbnail(&self, _path: &Path) -> Option<(String, Vec<u8>)> { ... }
fn base_path(&self) -> Option<&Path> { ... }
}
Available on crate feature
file_io
only.Expand description
This defines optional operations when creating Ingredient
structs from files.
Provided Methods§
sourcefn title(&self, _path: &Path) -> Option<String>
fn title(&self, _path: &Path) -> Option<String>
This allows setting the title for the ingredient.
If it returns None
, then the default behavior is to use the file’s name.
sourcefn hash(&self, _path: &Path) -> Option<String>
fn hash(&self, _path: &Path) -> Option<String>
Returns an optional hash value for the ingredient
This can be used to test for duplicate ingredients or if a source file has changed. If hash is_some() Manifest.add_ingredient will dedup matching hashes
sourcefn thumbnail(&self, _path: &Path) -> Option<(String, Vec<u8>)>
fn thumbnail(&self, _path: &Path) -> Option<(String, Vec<u8>)>
Returns an optional thumbnail image representing the asset
The first value is the content type of the thumbnail, i.e. image/jpeg The second value is bytes of the thumbnail image The default is to have no thumbnail, so you must provide an override to have a thumbnail image