From fd58ad12a0389b660922b03dc2d08d2e1c0f9e39 Mon Sep 17 00:00:00 2001 From: gronod Date: Tue, 25 Aug 2026 11:53:08 +0100 Subject: [PATCH 1/2] refactor(print): remove duplicate print commands and improve manifest JSON parsing (closes #67, closes #68) --- src-tauri/src/commands.rs | 63 --------------------------------------- src-tauri/src/lib.rs | 4 --- src/js/printtarg.js | 13 ++++---- 3 files changed, 6 insertions(+), 74 deletions(-) diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 7535eaf..7d3bdfc 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -490,69 +490,6 @@ pub async fn run_profcheck( state.spawn(app, id, binary, args, cwd).await } -#[tauri::command] -pub async fn get_windows_printers() -> Result, String> { - #[cfg(windows)] - { - crate::print::windows::get_printers().map(|list| list.into_iter().map(|p| p.name).collect()) - } - #[cfg(not(windows))] - { - Err("Windows native printing is only supported on Windows.".to_string()) - } -} - -#[tauri::command] -pub async fn print_target_windows( - state: State<'_, crate::print::PrinterDevModeStore>, - printer_name: String, - tiff_path: String, - options: Option, -) -> Result<(), String> { - #[cfg(windows)] - { - crate::print::windows::print_target(&printer_name, &tiff_path, options.as_ref(), Some(&state)) - } - #[cfg(not(windows))] - { - let _ = (state, printer_name, tiff_path, options); - Err("Windows native printing is only supported on Windows.".to_string()) - } -} - -#[tauri::command] -pub async fn get_cups_printers() -> Result, String> { - #[cfg(unix)] - { - crate::print::unix::get_printers() - } - #[cfg(not(unix))] - { - Err("CUPS printing is only supported on macOS and Linux.".to_string()) - } -} - -#[tauri::command] -pub async fn print_target_cups( - printer_name: String, - tiff_path: String, - options: Option, -) -> Result<(), String> { - #[cfg(unix)] - { - crate::print::unix::print_target( - &printer_name, - &tiff_path, - options.as_ref(), - ) - } - #[cfg(not(unix))] - { - let _ = (printer_name, tiff_path, options); - Err("CUPS printing is only supported on macOS and Linux.".to_string()) - } -} - #[tauri::command] pub async fn get_printers() -> Result, String> { #[cfg(windows)] diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index dd951e9..31cda44 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -28,10 +28,6 @@ pub fn run() { commands::run_chartread, commands::run_colprof, commands::run_profcheck, - commands::get_windows_printers, - commands::print_target_windows, - commands::get_cups_printers, - commands::print_target_cups, commands::get_printers, commands::get_printer_capabilities, commands::show_printer_properties, diff --git a/src/js/printtarg.js b/src/js/printtarg.js index cf789d4..3222048 100644 --- a/src/js/printtarg.js +++ b/src/js/printtarg.js @@ -477,14 +477,13 @@ export function initPrinttarg() { */ function extractManifest(stdout) { try { - const jsonStart = stdout.lastIndexOf('{\n "event": "manifest"'); - if (jsonStart === -1) return null; - const jsonEnd = stdout.indexOf('\n}', jsonStart); - if (jsonEnd === -1) return null; - const jsonStr = stdout.substring(jsonStart, jsonEnd + 2); - return JSON.parse(jsonStr); + const match = stdout.match(/\{[\s\S]*?"event"\s*:\s*"manifest"[\s\S]*?\n\}/); + if (match) { + return JSON.parse(match[0]); + } + return null; } catch (e) { - console.error("Failed to parse printtarg manifest:", e); + console.error("Failed to parse printtarg manifest JSON:", e); return null; } } -- 2.39.5 From 25b2be69f6621b5c12c4629815117a988ea25c22 Mon Sep 17 00:00:00 2001 From: gronod <1+gronod@noreply@i3omb.com> Date: Tue, 25 Aug 2026 12:18:33 +0100 Subject: [PATCH 2/2] docs: fix mermaid architecture diagram syntax and license badge/link (fixes #80) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ec26c01..b015510 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Release](https://img.shields.io/badge/version-v0.2.0-blue.svg)](https://git.i3omb.com/gronod/ICCery) [![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux-lightgrey.svg)](https://git.i3omb.com/gronod/ICCery) [![Framework](https://img.shields.io/badge/framework-Tauri%20v2%20%2B%20Rust-orange.svg)](https://tauri.app) -[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE) +[![License](https://img.shields.io/badge/license-Proprietary%20%2F%20EULA-blue.svg)](LICENCE.md) **ICCery** is a native GUI frontend designed to make creating custom ICC/ICM printer profiles seamless, visual, and reliable. It wraps the powerful color management capabilities of [ArgyllCMS](https://www.argyllcms.com/) within an intuitive, artefact-gated 5-stage wizard. @@ -35,7 +35,7 @@ flowchart TD UI[Wizard UI & Swatch Grid] ThreeJS[3D CIELAB Gamut Viewer] State[Wizard State & Artefact Verifier] - PrintEngine[Raw Print Subsystem (GDI / CUPS)] + PrintEngine["Raw Print Subsystem (GDI / CUPS)"] ProcMgr[Async Subprocess IPC Manager] UI <--> State @@ -95,4 +95,4 @@ npm run tauri build ## Licence -ICCery is licensed under the [MIT Licence](LICENSE). ArgyllCMS binaries and source code are licensed under the GNU Affero General Public License (AGPLv3). +The ICCery GUI application is proprietary software licensed under the terms of the [EULA](LICENCE.md). ArgyllCMS binaries and source code are licensed under the GNU Affero General Public License (AGPLv3). -- 2.39.5