Skip to content

docs(zarr-http-server): add an example serving a TIFF over HTTP - #293

Open
d-v-b wants to merge 2 commits into
mainfrom
claude/zarr-http-tiff-example-513cfa
Open

docs(zarr-http-server): add an example serving a TIFF over HTTP#293
d-v-b wants to merge 2 commits into
mainfrom
claude/zarr-http-tiff-example-513cfa

Conversation

@d-v-b

@d-v-b d-v-b commented Aug 13, 2026

Copy link
Copy Markdown
Owner

🤖 AI text below 🤖

tifffile.imread(path, return_as="zarr") returns a read-only
zarr.abc.store.Store backed by the TIFF's own tiles, so store_app can serve
a TIFF file directly — no conversion step, and no second copy of the data. This
adds an example demonstrating that.

What's here

  • examples/serve_tiff.py — writes a pyramidal OME-TIFF, opens it as a
    Zarr store with tifffile, serves it with store_app, then reads it back
    both as raw HTTP responses (httpx) and through a Zarr client
    (zarr.open_group(server.url)), asserting the pixels round-trip.
  • docs/guide.md — a Serving data that is not stored as Zarr section, and
    the example added to the guide's and README's example lists.
  • tests/test_examples.py — runs the new example, alongside the existing
    two.
  • pyproject.tomltifffile>=2026.5.2 in the examples dependency
    group, which CI already syncs, so the test runs there rather than skipping.

Notes

  • The version floor is real: 2026.5.2 is the first tifffile release whose Zarr
    store is a zarr format 3 Store, and the first with return_as. It is
    asserted in both the script's inline metadata and the test.
  • Two behaviors the example documents inline, since both are mildly surprising:
    tifffile decodes each TIFF tile as it reads it, so the served metadata lists
    no codec beyond bytes and a compressed TIFF still goes over the wire
    uncompressed; and HTTP exposes no directory listing, so the example walks
    resolution levels from the multiscales metadata rather than
    Group.arrays(), which silently yields nothing over HTTP.
  • Such a store reports read_only=True, so the existing read-only guarantees
    apply unchanged.

just lint, just test (214 passed), and just docs-check all pass.

🤖 Generated with Claude Code

d-v-b added 2 commits August 13, 2026 20:19
`tifffile.imread(path, return_as="zarr")` returns a read-only
`zarr.abc.store.Store` backed by the TIFF's own tiles, so `store_app` can
serve a TIFF directly with no conversion and no second copy of the data.

Adds `examples/serve_tiff.py`, which writes a pyramidal OME-TIFF, serves it,
and reads it back both as raw HTTP responses and through a zarr client; a
user guide section on serving data that is not stored as Zarr; and a test
that runs the example, with `tifffile` added to the `examples` dependency
group so it runs in CI rather than skipping.

Assisted-by: ClaudeCode:claude-opus-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant