Demeter · image service
Site La Télé
Put the transformations you need in front of the address of an image. Demeter downloads the original, renders it once, and serves it from its cache from then on.
Anatomy of a URL
https://latele.demeter.latele.ch/-/resize/800x600/-/format/webp/f/https://latele.ch/photo.jpg
- AccountEach account has its own sub-domain.
- OperationsAny number of
-/name/value, in any order. Optional. - /f/Separates operations from the original.
- OriginalFull URL of the image, on an allowed host.
What happens on a request
- The account is identified from the sub-domain.
- The host of the original is checked against the allowed hosts
(
latele.ch,staging.latele.ch,static.infomaniak.ch,img.latele.ch,ats.latele.ch,latele-img.b-cdn.net,onsort.latele.ch) - The original is downloaded (only the first time).
- The operations are applied and the result is stored.
- The image is sent with a one-year cache lifetime. Later requests skip steps 3 and 4.
Operations
| Operation | Value | Effect |
|---|---|---|
-/resize/… | {width}x{height} | Target size in pixels. Either side may be omitted: 800x, x600, 800. |
-/fit/… | contain | max | fill | fill-max | stretch | crop | cover | How the image fits the target size. Default: contain. crop-top-left, crop-center… set the focus point. |
-/dpr/… | 1 – 8 | Device pixel ratio: multiplies the target size. |
-/format/… | jpg | pjpg | png | gif | webp | avif | auto | Output format. Default: same as the original. auto picks the best format the browser accepts. |
-/quality/… | 0 – 100 | Compression quality for jpg, webp and avif. Default: 85. |
-/bri/… | -100 – 100 | Brightness. |
-/con/… | -100 – 100 | Contrast. |
-/gam/… | 0.1 – 9.99 | Gamma. |
-/sharp/… | 0 – 100 | Sharpen. |
-/blur/… | 0 – 100 | Blur. |
-/filt/… | greyscale | sepia | Colour filter. |
-/flip/… | h | v | both | Mirror the image. |
-/orient/… | auto | 0 | 90 | 180 | 270 | Rotation. Default: auto (follows EXIF). |
-/bg/… | hex colour, e.g. ffffff | Background colour for transparent images and fill. |
Unknown operations and out-of-range values are ignored. When an operation is repeated, the last one wins. Formats available on this server: jpg pjpg png gif webp avif . SVG originals are delivered unchanged.
Examples
/-/resize/800x/f/… | 800 pixels wide, height follows. |
/-/resize/400x400/-/fit/crop/f/… | Square thumbnail, cropped around the centre. |
/-/resize/600x/-/dpr/2/-/format/auto/f/… | Retina image in the best format the browser accepts. |
/-/format/webp/-/quality/70/f/… | Same size, lighter file. |
/f/… | The original, re-encoded and cached. |
URL builder
Good to know
| Changed original | An image is rendered once. To refresh it, purge it from the admin panel or run php artisan demeter:purge {url}. |
| Query strings | A ?query at the end of the address is ignored. To make it part of the original URL, URL-encode the original. |
403 | Account not found or Unauthorized origin (host not allowed). |
404 · 502 | The original does not exist, or its server could not be reached. |
413 · 415 · 422 | Original too large, not an image, or output format not supported. |