Add Photographer metadata preset and improve quality descriptions
Add Photographer mode to metadata step that keeps copyright and camera model while stripping GPS and software data. Improve compress quality descriptions with estimated file size reduction percentages.
This commit is contained in:
@@ -187,10 +187,10 @@ pub fn build_compress_page(state: &AppState) -> adw::NavigationPage {
|
||||
|
||||
fn quality_description(val: u32) -> String {
|
||||
match val {
|
||||
1 => "Web Optimized - smallest files, noticeable quality loss. Best for thumbnails.".into(),
|
||||
2 => "Low - small files, some quality loss. Good for email attachments.".into(),
|
||||
3 => "Medium - good balance of quality and size. Recommended for most uses.".into(),
|
||||
4 => "High - large files, minimal quality loss. Good for printing.".into(),
|
||||
_ => "Maximum - largest files, best possible quality. Archival use.".into(),
|
||||
1 => "Web Optimized - ~70-80% smaller files. Noticeable quality loss. Best for thumbnails and web previews.".into(),
|
||||
2 => "Low - ~50-60% smaller files. Some visible quality loss. Good for email attachments and quick sharing.".into(),
|
||||
3 => "Medium - ~30-40% smaller files. Good balance of quality and size. Recommended for most uses.".into(),
|
||||
4 => "High - ~15-25% smaller files. Minimal quality loss. Good for printing and high-quality output.".into(),
|
||||
_ => "Maximum - ~5-10% smaller files. Best possible quality, largest files. Archival and professional use.".into(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,6 +69,17 @@ pub fn build_metadata_page(state: &AppState) -> adw::NavigationPage {
|
||||
keep_all_row.add_suffix(&keep_all_check);
|
||||
keep_all_row.set_activatable_widget(Some(&keep_all_check));
|
||||
|
||||
let photographer_row = adw::ActionRow::builder()
|
||||
.title("Photographer")
|
||||
.subtitle("Keep copyright and camera model, strip GPS and software")
|
||||
.activatable(true)
|
||||
.build();
|
||||
photographer_row.add_prefix(>k::Image::from_icon_name("camera-photo-symbolic"));
|
||||
let photographer_check = gtk::CheckButton::new();
|
||||
photographer_check.set_group(Some(&strip_all_check));
|
||||
photographer_row.add_suffix(&photographer_check);
|
||||
photographer_row.set_activatable_widget(Some(&photographer_check));
|
||||
|
||||
let custom_row = adw::ActionRow::builder()
|
||||
.title("Custom")
|
||||
.subtitle("Choose exactly which metadata categories to strip")
|
||||
@@ -83,6 +94,7 @@ pub fn build_metadata_page(state: &AppState) -> adw::NavigationPage {
|
||||
|
||||
presets_group.add(&strip_all_row);
|
||||
presets_group.add(&privacy_row);
|
||||
presets_group.add(&photographer_row);
|
||||
presets_group.add(&keep_all_row);
|
||||
presets_group.add(&custom_row);
|
||||
content.append(&presets_group);
|
||||
@@ -163,6 +175,34 @@ pub fn build_metadata_page(state: &AppState) -> adw::NavigationPage {
|
||||
}
|
||||
});
|
||||
}
|
||||
{
|
||||
let jc = state.job_config.clone();
|
||||
let cg = custom_group.clone();
|
||||
let gps_c = gps_row.clone();
|
||||
let camera_c = camera_row.clone();
|
||||
let software_c = software_row.clone();
|
||||
let timestamps_c = timestamps_row.clone();
|
||||
let copyright_c = copyright_row.clone();
|
||||
photographer_check.connect_toggled(move |check| {
|
||||
if check.is_active() {
|
||||
let mut cfg = jc.borrow_mut();
|
||||
cfg.metadata_mode = MetadataMode::Custom;
|
||||
// Photographer: keep copyright + camera model, strip GPS + software
|
||||
cfg.strip_gps = true;
|
||||
cfg.strip_camera = false;
|
||||
cfg.strip_software = true;
|
||||
cfg.strip_timestamps = false;
|
||||
cfg.strip_copyright = false;
|
||||
// Update UI to match
|
||||
gps_c.set_active(true);
|
||||
camera_c.set_active(false);
|
||||
software_c.set_active(true);
|
||||
timestamps_c.set_active(false);
|
||||
copyright_c.set_active(false);
|
||||
cg.set_visible(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
{
|
||||
let jc = state.job_config.clone();
|
||||
let cg = custom_group.clone();
|
||||
|
||||
Reference in New Issue
Block a user