Presets
A preset is a named, versioned, immutable transformation recipe. Public URLs name one; they cannot describe one.
Built-ins
| Name | Width | Fit | Quality | DPR ceiling |
|---|---|---|---|---|
original-safe | unchanged | scale-down | 82 | 2 |
thumbnail | 320 | scale-down | 78 | 2 |
card | 640 | scale-down | 80 | 2 |
content | 1280 | scale-down | 82 | 2 |
hero | 1920 | scale-down | 82 | 2 |
Fields
width/height- Null means unchanged. All built-ins use
scale-down, so an image smaller than the target is never enlarged. formatPolicynegotiatepicks the best format the client accepts.preservekeeps the container and recompresses.force-webpprefers WebP but still yields to a client that cannot decode it — a policy is a preference, a declared capability is a fact.dprCeiling- The highest device-pixel-ratio variant emitted. This is what bounds the size of a responsive
srcset. sharpen- Applied only when the image is actually downscaled. Sharpening an unresized image adds bytes and artefacts for no benefit.
metadatanoneby default: EXIF often carries GPS coordinates and camera serial numbers that nobody intended to publish.
Versions and rollback
Presets are never edited in place. Publishing a change inserts a new version and repoints the project at it. The version is part of the cache key, so:
- existing cached derivatives keep the settings they were made with;
- new requests get the new settings immediately;
- rollback is pointing back at an older version — no data recovery, no cache surgery.
Responsive widths
A srcset is built from the preset's own width family, never from a width the caller supplies.card (640px, DPR ceiling 2) yields exactly two widths:
.../card/photo.jpg 640w, .../card-2x/photo.jpg 1280wIf you need another size, define a preset for it once. A component that accepted arbitrary widths would let a single page create dozens of derivatives of one image.