Image Parameters

Last updated


This page documents the query parameters GET /c/img/*path accepts, their defaults, and normalization rules.

Parameters


Each parameter has a short and a long name; utils.GetQuery takes the first non-empty one:
ShortLongDefaultDescription
oorigin01 returns the original file and ignores all transform parameters
ssize—Short-edge length (px); takes precedence over w / h
wwidth—Width (px)
hheight—Height (px)
qquality75 (50 for AVIF)Output quality, clamped to 0–100
ttypewebpOutput format
bblur0Gaussian blur sigma, clamped to 0–100
Bbright1Brightness multiplier
ddark—1 or dark switches error responses to the dark placeholder

b and B are case-sensitive: blur and brightness respectively.

Format and Quality


t valueOutputContent-TypeQuality
webp, empty, invalidWebPimage/webpq, default 75
jpg, jpegJPEG (jpeg normalized to jpg)image/jpegq, default 75
avifAVIFimage/avifq, default 50
pngPNGimage/pngNot applied

Unparseable q and b fall back to their defaults; an unparseable B fails the transform and returns the placeholder.

Examples


  1. # Short edge 480 px, AVIF, quality 60
  2. curl -o a.avif "http://localhost:8080/c/img/blog/photo.jpg?s=480&t=avif&q=60"
  3. # Width 800 px, blur 10, brightness 0.8, dark placeholder on failure
  4. curl -o b.webp "http://localhost:8080/c/img/blog/photo.jpg?width=800&blur=10&bright=0.8&dark=1"
  5. # Original file
  6. curl -o c.jpg "http://localhost:8080/c/img/blog/photo.jpg?o=1"

See Sizing Rules for how size parameters map to output dimensions and Image Pipeline for processing order.
中文