docs(zarr-http-server): add an example serving a TIFF over HTTP - #293
Open
d-v-b wants to merge 2 commits into
Open
docs(zarr-http-server): add an example serving a TIFF over HTTP#293d-v-b wants to merge 2 commits into
d-v-b wants to merge 2 commits into
Conversation
`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
Assisted-by: ClaudeCode:claude-opus-5
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.
🤖 AI text below 🤖
tifffile.imread(path, return_as="zarr")returns a read-onlyzarr.abc.store.Storebacked by the TIFF's own tiles, sostore_appcan servea 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 aZarr store with
tifffile, serves it withstore_app, then reads it backboth 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, andthe example added to the guide's and README's example lists.
tests/test_examples.py— runs the new example, alongside the existingtwo.
pyproject.toml—tifffile>=2026.5.2in theexamplesdependencygroup, which CI already syncs, so the test runs there rather than skipping.
Notes
tifffilerelease whose Zarrstore is a zarr format 3
Store, and the first withreturn_as. It isasserted in both the script's inline metadata and the test.
tifffiledecodes each TIFF tile as it reads it, so the served metadata listsno codec beyond
bytesand a compressed TIFF still goes over the wireuncompressed; 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.read_only=True, so the existing read-only guaranteesapply unchanged.
just lint,just test(214 passed), andjust docs-checkall pass.🤖 Generated with Claude Code