fix(gamut): set iccgamut surface resolution to 10 and extract build_iccgamut_args (fixes #112) #121

Merged
gronod merged 1 commits from fix/iccgamut-density into development 2026-08-28 18:53:03 +01:00
+16 -6
View File
@@ -247,6 +247,15 @@ pub fn get_profile_path(cwd: String, basename: String) -> String {
path.to_string_lossy().to_string() path.to_string_lossy().to_string()
} }
pub fn build_iccgamut_args(resolved_path: &str) -> Vec<String> {
vec![
"-v".to_string(),
"-d".to_string(),
"10".to_string(),
resolved_path.to_string(),
]
}
#[tauri::command] #[tauri::command]
pub async fn extract_gamut( pub async fn extract_gamut(
app: AppHandle, app: AppHandle,
@@ -276,12 +285,7 @@ pub async fn extract_gamut(
} }
}; };
let args = vec![ let args = build_iccgamut_args(&resolved_path);
"-v".to_string(),
"-d".to_string(),
"50.0".to_string(),
resolved_path,
];
let cwd = if parent_dir.is_empty() { let cwd = if parent_dir.is_empty() {
resolve_safe_cwd(&app, "").ok() resolve_safe_cwd(&app, "").ok()
} else { } else {
@@ -766,6 +770,12 @@ pub async fn print_target_native(
mod tests { mod tests {
use super::*; 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] #[test]
fn test_build_targen_args_rgb() { fn test_build_targen_args_rgb() {
let config = TargenConfig { let config = TargenConfig {