Wire DPI setting from resize step through to processing job

Add output_dpi field to JobConfig, ProcessingJob, and Preset.
Connect the DPI SpinRow in the resize step's advanced options to
update the config value.
This commit is contained in:
2026-03-06 15:41:25 +02:00
parent eb8da4b3e9
commit 1d33be1e3d
4 changed files with 12 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ pub struct ProcessingJob {
pub preserve_directory_structure: bool,
pub progressive_jpeg: bool,
pub avif_speed: u8,
pub output_dpi: u32,
}
impl ProcessingJob {
@@ -47,6 +48,7 @@ impl ProcessingJob {
preserve_directory_structure: false,
progressive_jpeg: false,
avif_speed: 6,
output_dpi: 72,
}
}

View File

@@ -44,6 +44,7 @@ impl Preset {
preserve_directory_structure: false,
progressive_jpeg: false,
avif_speed: 6,
output_dpi: 72,
}
}

View File

@@ -19,6 +19,7 @@ pub struct JobConfig {
pub resize_height: u32,
pub allow_upscale: bool,
pub resize_algorithm: u32,
pub output_dpi: u32,
// Adjustments
pub adjustments_enabled: bool,
pub rotation: u32,
@@ -226,6 +227,7 @@ fn build_ui(app: &adw::Application) {
resize_height: if remember { sess_state.resize_height.unwrap_or(0) } else { 0 },
allow_upscale: false,
resize_algorithm: 0,
output_dpi: 72,
adjustments_enabled: false,
rotation: 0,
flip: 0,
@@ -1454,6 +1456,7 @@ fn run_processing(_window: &adw::ApplicationWindow, ui: &WizardUi) {
}
job.preserve_directory_structure = cfg.preserve_dir_structure;
job.output_dpi = cfg.output_dpi;
job.overwrite_behavior = match cfg.overwrite_behavior {
1 => pixstrip_core::operations::OverwriteBehavior::AutoRename,
2 => pixstrip_core::operations::OverwriteBehavior::Overwrite,

View File

@@ -460,6 +460,12 @@ pub fn build_resize_page(state: &AppState) -> adw::NavigationPage {
jc.borrow_mut().resize_algorithm = row.selected();
});
}
{
let jc = state.job_config.clone();
dpi_row.connect_value_notify(move |row| {
jc.borrow_mut().output_dpi = row.value() as u32;
});
}
scrolled.set_child(Some(&content));