Art Studio: serve AVIF renditions of PhotoStack stacks instead of the raw ~117MB .tif #806

Closed
opened 2026-07-23 02:39:43 +00:00 by spikerj · 1 comment
Owner

Problem

On learn.spikersoft.com/tools/(tools:art-studio), opening a PhotoStack asset makes the browser load the raw fused 16-bit stacked .tif (~117 MB in the live case) as an <img> — in both the viewer's thumbnail strip and the click-to-enlarge preview. That's enormous and a 16-bit TIFF barely renders in a browser.

The AVIF derivative machinery already exists (#805: ArtImageDerivativeGenerator + ThumbnailAvifId/DisplayAvifId + presigned thumbnailUrl/displayUrl), but the orchestrator ran it only for Concept/Enrichment stages and explicitly skipped PhotoStack — so the stack had no AVIF renditions and every consumer fell back to url = the 117 MB original.

Note: the stacking format itself is correct — the pipeline stays 16-bit RGB TIFF end-to-end (developalign_fusestacked_*.tif); the .jpg files from align_fuse are browser-viewable derivatives, not the stack format. No fusion change needed.

Fix (extends #805, epic #718)

Keep the original .tif (download); generate two AVIF renditions per fused stack:

  • ~400 px thumbnail for the viewer gallery strip
  • ~2048 px preview for the click-to-enlarge overlay (crisp on 2× displays)

Backend — generalize ArtImageDerivativeGenerator to decode 16-bit TIFF via ImageSharp + a sized display (cavif can't read TIFF); trigger derivatives in ArtPipeStageOrchestrator for PhotoStack align_fuse stacked_* image-tiff outputs (not develop-frame tifs, depth_map.tif, or jpg previews). One-shot backfill tool tools/BackfillPhotoStackDerivatives for existing stacks.

Frontend — viewer strip shows only the stack results, bound to the small AVIF thumbnail; click-preview uses the ~2048 AVIF; a "Download original" button keeps the .tif one click away.

Follow-up (separate ticket)

Let owners upload a locally-edited .tif to replace/augment a stack (non-destructive, add-as-variant) with ClamAV scan + derivative regen.

## Problem On `learn.spikersoft.com/tools/(tools:art-studio)`, opening a PhotoStack asset makes the browser load the raw fused 16-bit stacked `.tif` (~117 MB in the live case) as an `<img>` — in both the viewer's thumbnail strip and the click-to-enlarge preview. That's enormous and a 16-bit TIFF barely renders in a browser. The AVIF derivative machinery already exists (#805: `ArtImageDerivativeGenerator` + `ThumbnailAvifId`/`DisplayAvifId` + presigned `thumbnailUrl`/`displayUrl`), but the orchestrator ran it only for `Concept`/`Enrichment` stages and explicitly skipped PhotoStack — so the stack had no AVIF renditions and every consumer fell back to `url` = the 117 MB original. Note: the stacking format itself is correct — the pipeline stays 16-bit RGB TIFF end-to-end (`develop` → `align_fuse` → `stacked_*.tif`); the `.jpg` files from `align_fuse` are browser-viewable derivatives, not the stack format. No fusion change needed. ## Fix (extends #805, epic #718) Keep the original `.tif` (download); generate two AVIF renditions per fused stack: - **~400 px thumbnail** for the viewer gallery strip - **~2048 px preview** for the click-to-enlarge overlay (crisp on 2× displays) **Backend** — generalize `ArtImageDerivativeGenerator` to decode 16-bit TIFF via ImageSharp + a sized display (cavif can't read TIFF); trigger derivatives in `ArtPipeStageOrchestrator` for PhotoStack `align_fuse` `stacked_*` `image-tiff` outputs (not develop-frame tifs, `depth_map.tif`, or jpg previews). One-shot backfill tool `tools/BackfillPhotoStackDerivatives` for existing stacks. **Frontend** — viewer strip shows only the stack results, bound to the small AVIF thumbnail; click-preview uses the ~2048 AVIF; a "Download original" button keeps the `.tif` one click away. ## Follow-up (separate ticket) Let owners upload a locally-edited `.tif` to replace/augment a stack (non-destructive, add-as-variant) with ClamAV scan + derivative regen.
Author
Owner

Resolved — merged to master:

  • Backend: spikersoft-backend PR #461 (generator + orchestrator + BackfillPhotoStackDerivatives tool)
  • Angular: spikersoft-angular PR #549 (viewer strip AVIF + click-preview + "Download original")

⚠️ Two deploy-time steps still outstanding before this is live end-to-end:

  1. Run tools/BackfillPhotoStackDerivatives (DRY_RUN=true first, then real) inside the ArtPipeProcessor image (needs cavif on PATH) so the existing live ~117MB stacks gain their AVIF thumbnail/preview ids — otherwise pre-existing assets keep loading the raw .tif.
  2. Deploy the backend worker + Angular.

Closing the code work; the backfill is tracked in the deploy checklist. Follow-up (edited-.tif upload) is #807.

Resolved — merged to `master`: - Backend: spikersoft-backend PR #461 (generator + orchestrator + `BackfillPhotoStackDerivatives` tool) - Angular: spikersoft-angular PR #549 (viewer strip AVIF + click-preview + "Download original") **⚠️ Two deploy-time steps still outstanding before this is live end-to-end:** 1. Run `tools/BackfillPhotoStackDerivatives` (`DRY_RUN=true` first, then real) **inside the ArtPipeProcessor image** (needs `cavif` on PATH) so the existing live ~117MB stacks gain their AVIF thumbnail/preview ids — otherwise pre-existing assets keep loading the raw `.tif`. 2. Deploy the backend worker + Angular. Closing the code work; the backfill is tracked in the deploy checklist. Follow-up (edited-`.tif` upload) is #807.
Sign in to join this conversation.