Skip to content

Serve full-resolution PNG output (fix 'Open full' giving a 512px thumbnail)#183

Merged
bscholer merged 1 commit into
mainfrom
worktree-full-res-output
May 14, 2026
Merged

Serve full-resolution PNG output (fix 'Open full' giving a 512px thumbnail)#183
bscholer merged 1 commit into
mainfrom
worktree-full-res-output

Conversation

@bscholer

Copy link
Copy Markdown
Owner

Summary

The "Open full" affordance on the terminal node linked to `/api/preview`, which thumbnails every artifact (PNG and FITS alike) to `THUMB_LONG_EDGE = 512` px. The `save_image` node writes a full-resolution PNG via Siril's `savepng`, but the UI never had a way to fetch it — users opened the link and got a tiny version of their multi-megapixel export.

Shape

  • New `/api/output/{node_hash}/{port}` endpoint:
    • PNG outputs: the committed file is returned as-is (no re-encode, no thumbnail).
    • FITS outputs: autostretched at full resolution, cached inside the entry as `output.png`. Repeat opens are a file read.
  • `server/preview.py` refactored to share dispatch logic; each renderer now takes a `max_dim: int | None` (None = full res). Cache filenames namespaced as `preview.png` vs `output.png` so thumbnail and full-res renders coexist in one entry.
  • UI `api.outputUrl()` mirrors `previewUrl` / `previewUrlStretched`. `PipelineRow`'s "Open full" button uses it. Tile thumbnails still call `previewUrl()`.

Test plan

  • 4 new tests in `tests/test_render_output.py` covering PNG pass-through (returns original file), FITS full-res (no `.thumbnail()` clipping), output caching (idempotent file path), preview/output cache namespacing.
  • Existing preview tests still pass (34/34).
  • Full suite: 682 passed, 1 skipped.
  • Ruff clean; svelte-check 0 errors.
  • In a browser: complete a project, click "Open full" on the final node, verify the PNG that opens is the full `save_image` resolution rather than a 512px thumbnail.

The 'Open full' affordance on the terminal node linked to /api/preview,
which thumbnailed every artifact (PNG and FITS alike) to 512px. The
save_image node produces a full-resolution PNG via Siril's `savepng`,
but the UI never had a way to fetch it -- users opened the link and
got a tiny version of their multi-megapixel export.

New /api/output/<node_hash>/<port> endpoint serves the actual artifact:
  - PNG outputs: the committed file is returned as-is. No re-encode,
    no thumbnail. The 6000x4000 save_image export survives intact.
  - FITS outputs: autostretched at full resolution and cached inside
    the entry as _output_<port>.png. Subsequent opens are a file read.

Cache filenames are namespaced (_preview_*.png vs _output_*.png) so
the in-page thumbnail and the full-res render coexist in one entry.

UI: api.outputUrl() mirrors previewUrl/previewUrlStretched. PipelineRow's
'Open full' button now points at it. The tile thumbnail still uses
previewUrl().
@bscholer
bscholer merged commit 96b2ff7 into main May 14, 2026
2 checks passed
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