Fix pipeline order, add selective metadata stripping, rename case/regex
- Move watermark step after compress in processing pipeline to match design doc order (resize, adjustments, convert, compress, metadata, watermark, rename) - Implement selective EXIF metadata stripping for Privacy and Custom modes using little_exif tag filtering (GPS, camera, software, timestamps, copyright categories) - Add case conversion support to rename (none/lower/upper/title) - Add regex find-and-replace on original filenames - Wire case and regex controls in rename step UI to JobConfig - Add regex crate dependency to pixstrip-core
This commit is contained in:
@@ -279,6 +279,10 @@ pub struct RenameConfig {
|
||||
pub counter_start: u32,
|
||||
pub counter_padding: u32,
|
||||
pub template: Option<String>,
|
||||
/// 0=none, 1=lowercase, 2=uppercase, 3=title case
|
||||
pub case_mode: u32,
|
||||
pub regex_find: String,
|
||||
pub regex_replace: String,
|
||||
}
|
||||
|
||||
impl RenameConfig {
|
||||
@@ -290,18 +294,23 @@ impl RenameConfig {
|
||||
width = self.counter_padding as usize
|
||||
);
|
||||
|
||||
// Apply regex find-and-replace on the original name
|
||||
let working_name = rename::apply_regex_replace(original_name, &self.regex_find, &self.regex_replace);
|
||||
|
||||
let mut name = String::new();
|
||||
if !self.prefix.is_empty() {
|
||||
name.push_str(&self.prefix);
|
||||
}
|
||||
name.push_str(original_name);
|
||||
name.push_str(&working_name);
|
||||
if !self.suffix.is_empty() {
|
||||
name.push_str(&self.suffix);
|
||||
}
|
||||
name.push('_');
|
||||
name.push_str(&counter_str);
|
||||
name.push('.');
|
||||
name.push_str(extension);
|
||||
name
|
||||
|
||||
// Apply case conversion
|
||||
let name = rename::apply_case_conversion(&name, self.case_mode);
|
||||
|
||||
format!("{}.{}", name, extension)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user