'policies' => [
'encode' => [ /* … */ ],
'geometry' => [ /* … */ ],
'safety' => [ /* … */ ],
'cleanup' => [ /* … */ ],
'fallback' => [ /* … */ ],
],| Key | Default | Effect |
|---|---|---|
| stripMetadata | true | Remove EXIF/IPTC from output when the driver supports it |
| progressive | false | Progressive/interlaced output where supported |
| pngCompression | 6 | PNG compression level (0–9) |
| Key | Default | Effect |
|---|---|---|
| allowUpscale | false | When false, resize/fit operations will not enlarge beyond the source dimensions |
| sharpness | sharp | Downscale sharpness preset or options (see below) |
'sharpness' => [
'preset' => 'sharp',
'blur' => 0.82, // Imagick resize blur (< 1 sharpens, > 1 softens)
'unsharp' => [ // or false to disable
'radius' => 0.0,
'sigma' => 0.6,
'amount' => 0.85,
'threshold' => 0.02,
],
],Changing sharpness regenerates derivatives (included in the generation identity). Prefer Imagick (or libvips) over GD for the sharpest downscales.
For WebP via cwebp, also see Encoders & optimizers (method, -sharp_yuv, custom arguments).
| Key | Default | Effect |
|---|---|---|
| maxSourcePixels | 40_000_000 | Reject sources whose width × height exceeds this limit after load |
Automatic derivative removal tied to Craft asset lifecycle events. Uses a lightweight per-asset index stored under @storage/super-images/asset-index/{assetId}.json — not a database table and not a full storage scan.
| Key | Default | Effect |
|---|---|---|
| onAssetDelete | true | Purge indexed derivatives before the Craft asset is deleted |
| onAssetReplace | true | Purge indexed derivatives when an asset file is replaced, before new generation is enqueued |
Each indexed entry records the derivative identity, storage path, and adapter handle. Purge deletes the storage object, removes the existence marker (for remote adapters), and clears the index file.
Preview artifacts under the preview/ namespace are handled separately — see CLI cleanup and cleanup.previewRetentionDays.
Bulk console cleanup (super-images/cleanup --orphaned / --all) is separately guarded by cleanup.generatedRetentionDays (default 365 days) so generated derivatives stay cached for at least a year by default, independent of the onAssetDelete/onAssetReplace hooks above — see CLI cleanup → Cache & retention.
Optional Twig delivery fallback when planning fails (missing asset, invalid source, etc.). Applies to url(), img(), picture(), and srcset() — not to strict generate().
| Key | Default | Effect |
|---|---|---|
| enabled | false | When true, retry planning once with the fallback asset |
| assetId | null | Craft asset ID to use as fallback (must differ from the requested asset) |
'policies' => [
'fallback' => [
'enabled' => true,
'assetId' => 42, // placeholder Asset in Craft
],
],{{ craft.superImages.img(entry.heroImage.one(), { profile: 'responsive', variant: 'md' }) }}If the hero asset cannot be resolved, Super Images plans delivery using asset 42 with the same profile/variant/format options. Fallback is attempted at most once per call.