Thumbnail Service
Thumbnails of w3ds://file images at the pixel height or width you ask for.
Request
GET https://thumbnail-service.w3ds.dev/thumb?uri=<file URI>&h=<pixels>&w=<pixels>
| Parameter | Meaning |
|---|---|
uri | The file's URI, w3ds://file?id=@<ename>/<meta-envelope-id>, URL-encoded. Required. |
h | Height in pixels, 16 to 2048. |
w | Width in pixels, 16 to 2048. |
Give h, w, or both. The thumbnail fits inside that box, keeps its aspect ratio and is never larger than the original.
Response
A 302 redirect to the thumbnail, a WebP image. Use the request URL directly as an image source:
<img src="https://thumbnail-service.w3ds.dev/thumb?uri=w3ds%3A%2F%2Ffile%3Fid%3D%40alice%2Fabc123&h=200" alt="">
In JavaScript, encode the file URI yourself:
const src = "https://thumbnail-service.w3ds.dev/thumb?uri=" + encodeURIComponent(fileUri) + "&h=200";
The first request for a size makes the thumbnail, which can take a few seconds. After that the same size is served from storage.
Try it
Errors
Errors are JSON, { "error": "…" }.
| Status | Meaning |
|---|---|
400 | Missing or invalid uri, h or w. |
404 | The owner's eVault has no such file. |
413 | The original is larger than 25 MB. |
415 | The file is not an image that can be resized. |
502 | The Registry, an eVault or file storage could not be reached. |
What it supports
- JPEG, PNG, WebP, GIF, AVIF and TIFF originals up to 25 MB. Animated images give a still of the first frame.
- Other files, including PDF, video and SVG, answer
415. - No sign-in. Files addressed by
w3ds://fileare public, and so are their thumbnails.
How it works
- The file's owner is looked up at the Registry and the file in the owner's eVault, which stays the source of truth.
- The thumbnail is stored as a public file in this service's own eVault and found again by name.
- Each file is checked again after five minutes. Once its eVault no longer has it, requests answer
404and its thumbnails are removed.