skip tagged files before image conversion
}
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)
+ let _ = rexiv2::register_xmp_namespace("http://trevor.town/pww/1.0/", "photo-what-what");
+ let pww_tag = "Xmp.photo-what-what.processed"
+ meta.clear_tag(pww_tag);
+ meta.set_tag_numeric(pww_tag, 1)
.map_err(|_e| PwwError::Unknown("Couldn't set pww processed tag".into()))?;
+ if config.verbose() {
+ println!(" - set pww processed flag");
+ }
}
match config.dry_run() {
println!("Analyzing: {}", analyze_path.to_string_lossy());
}
+ // Check sidecar file before analysis because it's a common error
+ // and we might as well not waste time analyzing when the tags
+ // won't be writeable.
+ let metafile = match should_update_sidecar(&config, &input_path)? {
+ Some(p) => p,
+ None => input_path.to_owned(),
+ };
+
+ // Check the metadata to see if this file has already been
+ // processed, and skip it if configured to do so.
+ let _ = rexiv2::register_xmp_namespace("http://trevor.town/pww/1.0/", "photo-what-what");
+ let meta = rexiv2::Metadata::new_from_path(&metafile)
+ .map_err(|e| PwwError::Unknown(format!("Unable to read metadata from image file: {}", e)))?;
+ let pww_tag = "Xmp.photo-what-what.processed"
+ if config.skip_processed() && meta.get_tag_numeric(pww_tag) == 1 {
+ if config.verbose() {
+ println!(" - already processed, skipped!")
+ }
+ return Ok(());
+ }
+
// Transcode to a temporary file if necessary
match image_needs_conversion(&config, &input_path) {
Ok(true) => {
_ => {},
}
- // Check sidecar file before analysis because it's a common error
- // and we might as well not waste time analyzing when the tags
- // won't be writeable.
- let metafile = match should_update_sidecar(&config, &input_path)? {
- Some(p) => p,
- None => input_path.to_owned(),
- };
-
- // Check the metadata to see if this file has already been
- // processed, and skip it if configured to do so.
- let _ = rexiv2::register_xmp_namespace("pww", "photo-what-what");
- let meta = rexiv2::Metadata::new_from_path(&metafile)
- .map_err(|e| PwwError::Unknown(format!("Unable to read metadata from image file: {}", e)))?;
- if config.skip_processed() && meta.get_tag_numeric("Xmp.photo-what-what.processed") == 1 {
- if config.verbose() {
- println!(" - already processed, skipped!")
- }
- return Ok(());
- }
-
// run ML engine on file
if config.debug() {
if analyze_path != input_path {