fix: use each triplet's own exposures in batch export (#382)#398
Merged
Conversation
Batch export built per-frame params from the saved DB config and never re-injected the frame's own RGB-scan green/blue exposures from the asset dict. A frame whose DB config held a stale/missing exposure path (prior session, RGB-mode regroup, or session restore) decoded a nonexistent file, which rawpy surfaces as b'Input/output error' — so "export all" failed on most triplet frames while individual export (which re-injects via select_file) worked. Route all three batch task-builders through resolve_asset_rgbscan so each frame uses its own discovery-verified exposures, matching single-file export. Guard _load_source_f32 to raise a clear FileNotFoundError when a triplet exposure is genuinely missing instead of the cryptic LibRaw bytes.
jboneng
added a commit
to jboneng/NegPy
that referenced
this pull request
Jul 4, 2026
…cted Integrate RGB-scan batch params (marcinz606#398) into the preset export refactor while keeping selected-frame main button and excluded-frame filtering. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #382.
Problem
Bulk-exporting RGB-scan (trichrome) triplets fails on most frames with
Export pipeline failed: b'Input/output error'— only a couple export. Individual export works.b'Input/output error'is rawpy/LibRaw on a nonexistent path (reproduced:rawpy.imread(missing)raises exactly this).Root cause
select_filefreshly re-injects each triplet's green/blue exposure paths from the discovery-verified asset dict intostate.config.Fix
resolve_asset_rgbscan(params, asset)— pure helper insession.py: re-injects a frame's own green/blue/align from the asset dict; resets rgbscan for non-triplet frames so a batch frame never inherits the currently-open frame's config._batch_params_for(f)— routes all three batch task-builders (request_batch_export,request_preset_batch_export,request_contact_sheet) through it, so batch uses the same authoritative source as single-file export._load_source_f32: a genuinely-missing exposure now raises a clearFileNotFoundError: RGB-scan green exposure not found: <path>instead of cryptic LibRaw bytes. The batch worker already continues per-file.Tests
test_rgbscan.py): inject-from-asset overrides a stale config, align honored, reset-when-not-triplet.make allgreen: lint + type clean, 1109 passed.Manual repro (real triplet folder + "Export all") still recommended before release.