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

What happens on a request

  1. The account is identified from the sub-domain.
  2. 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)
  3. The original is downloaded (only the first time).
  4. The operations are applied and the result is stored.
  5. The image is sent with a one-year cache lifetime. Later requests skip steps 3 and 4.

Operations

OperationValueEffect
-/resize/…{width}x{height}Target size in pixels. Either side may be omitted: 800x, x600, 800.
-/fit/…contain | max | fill | fill-max | stretch | crop | coverHow the image fits the target size. Default: contain. crop-top-left, crop-center… set the focus point.
-/dpr/…1 – 8Device pixel ratio: multiplies the target size.
-/format/…jpg | pjpg | png | gif | webp | avif | autoOutput format. Default: same as the original. auto picks the best format the browser accepts.
-/quality/…0 – 100Compression quality for jpg, webp and avif. Default: 85.
-/bri/…-100 – 100Brightness.
-/con/…-100 – 100Contrast.
-/gam/…0.1 – 9.99Gamma.
-/sharp/…0 – 100Sharpen.
-/blur/…0 – 100Blur.
-/filt/…greyscale | sepiaColour filter.
-/flip/…h | v | bothMirror the image.
-/orient/…auto | 0 | 90 | 180 | 270Rotation. Default: auto (follows EXIF).
-/bg/…hex colour, e.g. ffffffBackground 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 originalAn image is rendered once. To refresh it, purge it from the admin panel or run php artisan demeter:purge {url}.
Query stringsA ?query at the end of the address is ignored. To make it part of the original URL, URL-encode the original.
403Account not found or Unauthorized origin (host not allowed).
404 · 502The original does not exist, or its server could not be reached.
413 · 415 · 422Original too large, not an image, or output format not supported.