#[arg(long)]
keep_converted: bool,
+ /// Disables setting of the pww processed metadata field.
+ #[arg(long)]
+ disable_pww_tag: bool,
+
/// Image files to analyze and tag
#[arg(trailing_var_arg = true, allow_hyphen_values = true, value_name = "IMAGE", required = true)]
image_paths: Vec<PathBuf>,
/// metadata.
forbidden_tags: Vec<String>,
+ /// Disables setting of the pww processed metadata field.
+ ///
+ /// pww sets an Xmp tag indicating it has processed a file. This
+ /// can be used to skip reprocessing of files that have already
+ /// been handled.
+ disable_pww_tag: bool,
+
#[serde(skip_serializing, skip_deserializing)]
cli: Option<PwwArgs>,
}
fn keep_converted(&self) -> bool {
self.cli.as_ref().map(|c| c.keep_converted).unwrap_or_default()
}
+
+ fn disable_pww_tag(&self) -> bool {
+ self.cli.as_ref().map(|c| c.disable_pww_tag).unwrap_or_default()
+ }
}
impl ::std::default::Default for PwwConfig {
ValidImageColor::Rgba16
),
halt_on_error: false,
+ disable_pww_tag: false,
permitted_tags: vec!(),
forbidden_tags: vec!(),
cli: None,
}
}
+ if !config.disable_pww_tag() {
+ let _ = rexiv2::register_xmp_namespace("pww", "photo-what-what");
+ meta.clear_tag("Xmp.photo-what-what.processed");
+ meta.set_tag_numeric("Xmp.photo-what-what.processed", 1)
+ .map_err(|_e| PwwError::Unknown("Couldn't set pww processed tag".into()))?;
+ }
+
match config.dry_run() {
false => {
meta.save_to_file(&filepath)