diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index d93634e..03b2ede 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -247,6 +247,15 @@ pub fn get_profile_path(cwd: String, basename: String) -> String { path.to_string_lossy().to_string() } +pub fn build_iccgamut_args(resolved_path: &str) -> Vec { + vec![ + "-v".to_string(), + "-d".to_string(), + "10".to_string(), + resolved_path.to_string(), + ] +} + #[tauri::command] pub async fn extract_gamut( app: AppHandle, @@ -276,12 +285,7 @@ pub async fn extract_gamut( } }; - let args = vec![ - "-v".to_string(), - "-d".to_string(), - "50.0".to_string(), - resolved_path, - ]; + let args = build_iccgamut_args(&resolved_path); let cwd = if parent_dir.is_empty() { resolve_safe_cwd(&app, "").ok() } else { @@ -766,6 +770,12 @@ pub async fn print_target_native( mod tests { use super::*; + #[test] + fn test_build_iccgamut_args() { + let args = build_iccgamut_args("/path/to/profile.icc"); + assert_eq!(args, vec!["-v", "-d", "10", "/path/to/profile.icc"]); + } + #[test] fn test_build_targen_args_rgb() { let config = TargenConfig {