Expand description
Thumbnails of image jobs, so the tray UI can show what a job made.
The daemon decodes an image result, scales it to fit
THUMBNAIL_MAX_SIDE and keeps it as PNG in a bounded Thumbnails
ring keyed by job id. The tray UI keeps its own copy (fetched from
GET /jobs/:id/thumbnail) in the same type.
Structs§
- Thumbnails
- Bounded ring of PNG thumbnails keyed by job id, oldest evicted first. Cheap to clone.
Constants§
- THUMBNAILS_
CAP - Thumbnails of this many most recent image jobs are kept: the size of the studio and local job rings together.
- THUMBNAIL_
MAX_ SIDE - Longer side of a thumbnail, in pixels: crisp on the UI’s 88 pt card tile on a 2x display, and large enough to recognise when shown larger. About 0.1 to 0.4 MB of PNG each, so the 100 kept stay within tens of MB.
Functions§
- make_
thumbnail - Scale an encoded image (WEBP / PNG / JPEG) to fit
THUMBNAIL_MAX_SIDEand encode it as PNG. Smaller images keep their size.