Skip to content

feat: TIFF series the reader cannot place are refused by name (TIFFError.unsupportedSeries) - #62

Merged
Paullo9 merged 1 commit into
mainfrom
issue-6-tiff-series-refusal
Oct 31, 2026
Merged

Paullo9 merged 1 commit into
mainfrom
issue-6-tiff-series-refusal

Conversation

@Paullo9

@Paullo9 Paullo9 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Requested by Paul · project thread

Part of #6

Summary

A multi-page TIFF whose pages do not make one series the reader takes is now refused with a typed, named error,
TIFFError.unsupportedSeries(file:series:), instead of a generic FormatoReadError.unsupported without the file name.
The kinds: an OME-TIFF series; a pyramid of reduced-resolution pages (a page with the reduced bit, or a page one
sampling step below the first, as tifffile pyramidize_series does in its generic rule); N series of pages that differ
in shape, type or layout; and the ImageJ and tifffile-shaped stacks the reader cannot place. No file that reads today
is refused; only the error on paths that already refused changes. The DocC article names the new case.

Migration

Code that caught FormatoReadError.unsupported for these files catches TIFFError.unsupportedSeries instead. An
exhaustive switch on TIFFError adds the new case (the apps only use if case, so they need no change).

Tests

  • Red first: TIFFSeriesRefusalTests (new) does not compile on main, as the case does not exist; green on this branch.
  • It builds multi-page TIFFs byte by byte: two page shapes, a reduced pyramid, a half-size page without the reduced
    bit, an OME description; each checks the typed case, the file name and the text. A uniform stack still reads.
  • tools/test.sh --skip FormatoKitParityTests -j 1: green, no warnings.
  • Reviewed before commit (public API): no blockers; wording widened to "shape, type or layout" and the pyramid rule
    aligned with tifffile after the review.

Remaining in #6

  • Vendor calibrations (TVIPS, Zeiss SEM, JEOL SightX pixel size): next PR.
  • The ImageJ and shaped-series refusal branches carry the new case but have no planted file of their own yet.

🤖 Generated with Claude Code

…ror.unsupportedSeries)

A multi-page TIFF whose pages do not make one series the reader takes now throws
TIFFError.unsupportedSeries(file:series:) with the file name and the kind of series:
an OME-TIFF series, a pyramid of reduced-resolution pages (the reduced bit, or a page
one sampling step below the first, as tifffile pyramidize_series does), N series of
pages that differ in shape, type or layout, and the ImageJ and shaped stacks it cannot
place. Before, these threw FormatoReadError.unsupported without the file name.

Tests: TIFFSeriesRefusalTests builds multi-page TIFFs byte by byte (two shapes, a
reduced pyramid, a half-size page without the bit, an OME description) and checks the
typed case and its text; a uniform stack still reads.

Migration: code that caught FormatoReadError.unsupported for these files catches
TIFFError.unsupportedSeries instead; an exhaustive switch on TIFFError adds the case.

Done: series refusals are typed and named (part of #6). Next: vendor pixel-size calibrations (TVIPS, Zeiss SEM, JEOL SightX) in their own PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Paullo9 Paullo9 self-assigned this Oct 31, 2026
@Paullo9
Paullo9 merged commit 1978c85 into main Oct 31, 2026
8 checks passed
@Paullo9
Paullo9 deleted the issue-6-tiff-series-refusal branch October 31, 2026 14:57
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.

1 participant