Skip to content

fix(export): current-file export dropped RGB-scan triplet / stitch config - #813

Merged
marcinz606 merged 6 commits into
marcinz606:mainfrom
thetalkingdrum:fix/linear-output-current-file-triplet
Aug 12, 2026
Merged

fix(export): current-file export dropped RGB-scan triplet / stitch config#813
marcinz606 merged 6 commits into
marcinz606:mainfrom
thetalkingdrum:fix/linear-output-current-file-triplet

Conversation

@thetalkingdrum

Copy link
Copy Markdown
Contributor

What

request_linear_output_export() and request_preset_export() each built a
bare {path, name, hash} dict for the current file instead of reusing its
entry from uploaded_files. That stripped-down dict then went through
resolve_asset_rgbscan() / resolve_asset_stitch(), which reset rgbscan
(and stitch) to disabled whenever the asset dict had no green_path/
blue_path (or stitch fields) — even though the live session config already
had them set correctly.

Net effect: exporting the current file only (not batch/selected/all) via
Linear Output or Export Presets on an RGB-scan triplet (or a stitched
composite with embedded triplets) silently exported just the primary
narrowband exposure instead of the merged RGB. Preview rendering was never
affected — it hydrates state.config through the same resolver but always
from the real asset dict (select_file()), so this only hit the two export
call sites that rebuilt their own dict.

Both call sites now look up the file in uploaded_files by hash first,
falling back to the minimal dict only if it's genuinely not there —
matching the pattern request_export() already used.

Why current-file only

request_batch_export, request_export_selected, and the preset
batch/selected variants all pull directly from uploaded_files, so they
were unaffected. Only the two single-current-file paths constructed their
own dict.

Testing

  • Added TestLinearOutputExportCurrentFile and
    TestPresetExportCurrentFileTriplet in tests/test_controller.py — both
    reproduce the bug against the old code (assert fails) and pass against the
    fix.
  • Verified end-to-end by driving the real AppController (real
    DesktopSessionManager/StorageRepository, rawpy.imread faked to avoid
    needing real camera-raw bytes): selected a triplet asset, called
    request_linear_output_export() with no args (the buggy path), and
    confirmed the exported TIFF has all three channels correctly sourced from
    their respective exposures instead of collapsing to the primary file.
  • make all: lint and type-check clean; full suite passes except one
    pre-existing, unrelated failure in test_overflow_bar.py (reproduces
    identically on main, not touched by this change).

request_linear_output_export and request_preset_export built a bare
{path, name, hash} dict for the current file instead of its uploaded_files
entry, so resolve_asset_rgbscan/resolve_asset_stitch found no green_path/
blue_path (or stitch fields) and silently reset the triplet/composite —
exporting only the primary narrowband exposure instead of the merged RGB.
@marcinz606
marcinz606 merged commit 895e650 into marcinz606:main Aug 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants