Bug: Patch count selection is ignored during target generation (defaults to 836 patches) #44

Closed
opened 2026-08-24 18:00:53 +01:00 by gronod · 0 comments
Owner

Description

Regardless of the patch count selected in the UI (e.g. 400, 800, 1500, 2500, or Custom), ArgyllCMS targen always generates exactly 836 patches for RGB targets.

Root Cause

In src-tauri/src/commands.rs, build_targen_args only checks config.total_patches when appending the -f flag to targen command arguments (if let Some(patches) = config.total_patches). However, the frontend (src/js/targen.js) sends patch_count in the payload without setting total_patches. Because total_patches is None, the -f flag is omitted completely from the targen command line. When targen is executed without -f, ArgyllCMS defaults to its built-in formula, producing 836 patches.

Solution

  1. Update build_targen_args in src-tauri/src/commands.rs to read config.patch_count (and config.total_patches as fallback) and include -f <patch_count>.
  2. Update src/js/targen.js to send patch_count and total_patches with proper validation.
  3. Update unit tests in src-tauri/src/commands.rs.
  4. Bump patch version to 0.1.5.
### Description Regardless of the patch count selected in the UI (e.g. 400, 800, 1500, 2500, or Custom), ArgyllCMS `targen` always generates exactly 836 patches for RGB targets. ### Root Cause In `src-tauri/src/commands.rs`, `build_targen_args` only checks `config.total_patches` when appending the `-f` flag to `targen` command arguments (`if let Some(patches) = config.total_patches`). However, the frontend (`src/js/targen.js`) sends `patch_count` in the payload without setting `total_patches`. Because `total_patches` is `None`, the `-f` flag is omitted completely from the `targen` command line. When `targen` is executed without `-f`, ArgyllCMS defaults to its built-in formula, producing 836 patches. ### Solution 1. Update `build_targen_args` in `src-tauri/src/commands.rs` to read `config.patch_count` (and `config.total_patches` as fallback) and include `-f <patch_count>`. 2. Update `src/js/targen.js` to send `patch_count` and `total_patches` with proper validation. 3. Update unit tests in `src-tauri/src/commands.rs`. 4. Bump patch version to `0.1.5`.
Sign in to join this conversation.