Image scaling and allowed sizes Last updated: 11. Aug 2026
How image scaling URLs work and how to control which sizes are allowed via images.sizePolicy in site.json.
Image URL: /path/photo.jpg/WxHxM/seo-name.jpg. Without any restriction the site accepts any size (each unique size costs CPU plus its own cache entry). The images.sizePolicy key in site.json controls how sizes are enforced.
The WxHxM key: W = width in px, H = height in px. 0 on ONE axis means no limit on that axis — the axis is derived from the image's aspect ratio, so 1400x0 means at most 1400 px wide. 0x0 means no scaling at all: the source is served as it is — use linkFile instead. Negative values return HTTP 400. M = scaling mode (0 = ScaleToFit default, 1 = ScaleToFill, …). "1200x800" is treated as mode 0.
Size policies (images.sizePolicy)
Policy | Behaviour |
|---|---|
| Any size. Only |
| Accepts |
| An unknown size returns HTTP 400. No self-expansion. |
Admin (the 'Image sizes' tab in folder properties): choose policy/cap, review the approved and discovered lists ('Promote'), and run 'Scan pages now' for a preview (add / remove / keep) before writing. If site.json is missing, it is created on save.
Shared per folder: several templates and aliases share the same site.json — the policy is managed in one place and 'Scan' covers all the templates. URLs generated by client-side JavaScript are not discovered and must be added to allowedSizes manually.
Not subject to sizePolicy: scaleImage and attachFile64 run server-side and are controlled by your own code — only the WxHxM URL is enforced.
Output format: for URL-based scaling, the extension on the seo-name segment (.jpg/.jpeg, .png, .webp, .avif) picks the output format — set it via linkImage's filename argument. Only .webp and .avif depend on images.sizePolicy: under the default "open" policy they fall back to auto, which keeps PNG for PNG sources and produces JPEG for everything else. Set images.sizePolicy to "auto" or "strict" for real WebP/AVIF output. The .jpg/.jpeg and .png extensions work under every policy. See Image output formats (WebP / AVIF).