Skip to content

BUG: Let ReadImageInformation succeed for unconfigured codecs - #6913

Merged
blowekamp merged 1 commit into
InsightSoftwareConsortium:release-5.4from
blowekamp:backport-tiff-unconfigured-codec-release-5.4
Sep 28, 2026
Merged

blowekamp merged 1 commit into
InsightSoftwareConsortium:release-5.4from
blowekamp:backport-tiff-unconfigured-codec-release-5.4

Conversation

@blowekamp

@blowekamp blowekamp commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Backport of #6904 (c037e7e) to release-5.4. Closes #6902.

AI assistance
  • Tool: Claude Code
  • Role: performed the cherry-pick, verified a clean apply against release-5.4, built the ITKIOTIFF module and ran its test suite (64/64 passed) before pushing
  • All code is identical to the reviewed main-branch commit; no manual changes were needed

ReadImageInformation only reports metadata derived from tags read
independently of codec support, yet threw immediately whenever the
compression codec was not configured. Defer that failure to Read(),
which is what actually needs decoding.

TIFFFindCODEC returns nullptr for schemes with no registered codec,
leaving the codec name as the literal string "unknown"; report the
raw compression tag value in that case instead.

Issue: InsightSoftwareConsortium#6902
(cherry picked from commit c037e7e)
@github-actions github-actions Bot added type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances area:IO Issues affecting the IO module labels Sep 28, 2026
@blowekamp
blowekamp marked this pull request as ready for review September 28, 2026 12:49
@blowekamp

Copy link
Copy Markdown
Member Author

@dzenanz These dashboard failures: https://open.cdash.org/builds/11582294/tests?filters=%7B%22all%22%3A%5B%7B%22eq%22%3A%7B%22status%22%3A%22FAILED%22%7D%7D%5D%7D appear to be cause by "out of disk space" rather than this recent commit to main.

@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Changes when TIFF codec errors are reported during image reading.

The PR appears safe to merge, with a non-blocking gap in regression coverage for unavailable codecs.

Findings

  1. P2 Missing codec regression coverage ▶
Summary

The PR lets TIFF metadata inspection succeed when the file’s codec is unavailable, while moving the codec failure to pixel reading.

  • Preserves metadata access without promising pixel decoding.
  • Adds a decode-time error for named and unknown codecs.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[TIFF file] --> B[ReadImageInformation]
  B --> C[Tag-derived metadata]
  C --> D[Read pixels]
  D --> E{Codec configured?}
  E -->|No| F[Codec exception]
  E -->|Yes| G[Decode pixels]
Loading

Reviews (1) · Last reviewed commit: "BUG: Let ReadImageInformation succeed fo..."

Comment thread Modules/IO/TIFF/src/itkTIFFImageIO.cxx
@blowekamp
blowekamp merged commit 9bd51fe into InsightSoftwareConsortium:release-5.4 Sep 28, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:IO Issues affecting the IO module type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants