Hide _IR TIFF sidecars from the contact sheet - #668
Merged
Conversation
Asset discovery matched any .tif in a folder, so a scanner's frame001.tif + frame001_IR.tif (+ _IR_VALID) pair imported as two or three separate assets. The IR planes are already read off the main file by TiffLoader, so they are never assets of their own. is_ir_sidecar_path() in loaders/constants.py is now the single source for the convention, shared by the loader's read side and both discovery scanners (AssetDiscoveryWorker and the hot-folder watcher). An orphan _IR.tif with no main TIFF beside it stays visible — nothing else would open it.
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.
Problem
Loading a folder of scanner TIFFs showed each frame two or three times in the contact sheet:
frame001.tif,frame001_IR.tifandframe001_IR_VALID.tifall matched the supported-extension filter and were hashed and imported as standalone assets.TiffLoaderalready reads the IR companion off the main file, so those files should never be assets of their own.Change
is_ir_sidecar_path()innegpy/infrastructure/loaders/constants.pyis the single source of truth for the_IR/_IR_VALIDconvention: TIFF extension, stem ending in an IR token, and a main TIFF present in the same directory (case-insensitive name compare, matching the loader's own lookup).AssetDiscoveryWorker.process(covers Add Files / Add Folder / drag-drop / session restore / capture imports) andFolderWatchService.scan_for_new_files(hot folder, which would otherwise re-add them seconds later)._read_sidecar_irbuilds its suffix tuples from the same constant so read and hide can't drift.An orphan
_IR.tifwith no main TIFF beside it stays visible — nothing else would ever open it. Sidecars imported by earlier sessions drop out on next launch, since restore feeds their paths back through the same filter.Verification
make allgreen (2681 passed, 1 skipped).tests/test_ir_sidecar_discovery.pycovers the predicate (incl. lowercase_ir, mixed-case main, orphan, non-TIFF) and the watcher.AssetDiscoveryWorkeron aframe1.tif+frame1_IR.tif+frame1_IR_VALID.tif+orphan_IR.tiffolder: assets =['frame1.tif', 'orphan_IR.tif'], andTiffLoader().load("frame1.tif")still returns bothirandir_valid_mask.