fix(export): write the IR TIFF sidecar without the source filename in its description - #887
Merged
marcinz606 merged 1 commit intoAug 18, 2026
Conversation
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.
Closes #879
Implements the fix as scoped by @thetalkingdrum in the issue thread:
_write_ir_tiffnow writes a fixed ASCII description (NegPy Linear Output -- infrared channel.), matching_write_tiff's fixed-string style — no filename, so tag 270 can never see non-ASCII bytes.imwriteis wrapped intry/exceptfollowing the_write_tiffextratags precedent: a sidecar failure no longer kills the export._irstub is left looking like a real file.source_nameparameter is dropped; the only caller passedos.path.basename(file_path)purely for the description.Test:
test_ir_sidecar_survives_non_ascii_source_filenamecopies the 4-channel LinearRaw DNG fixture tonégatif_şcan.dng, exports as TIFF, and asserts the sidecar exists, is larger than a bare header, decodes as uint16, and carries no filename in its description. It fails on current main with tifffile'sValueError: TIFF strings must be 7-bit ASCIIand passes with this change.Testing: full suite on Windows 11 / Python 3.13: 4259 passed, 10 skipped, 11 deselected, 0 failed (
tests/test_linear_output.pyalone: 169 passed).ruff check(pinned 0.14.10) clean on both changed files.Deliberately unchanged, per the issue discussion: the
_build_xmpgate stayscamera_wb-only, so the filename is not relocated into XMP.