Core Concepts
InterventionImage wraps Intervention Image v4.4 behind ProcessWire’s native Pageimage API with predictable disk caching and automatic cleanup.
Variation & Sidecar Pipeline
Section titled “Variation & Sidecar Pipeline”flowchart TD
A["Template calls $image->render('landscape') or $image->size(800, 600)"] --> B["Driver Probe (vips -> imagick -> gd)"]
B --> C{"delayed option enabled?"}
C -- Yes --> D["Write {variation}.queue sidecar descriptor"]
D --> E["Encode on first request or via CLI image:queue"]
C -- No --> F["Encode WebP / AVIF / Original variation immediately"]
E --> G["Serve cached variation + optional .lqip.webp"]
F --> G
A --> H["Optional analysis: .colors.json & .hashes.json sidecars"]
1. Driver Auto-Probe (vips -> imagick -> gd)
Section titled “1. Driver Auto-Probe (vips -> imagick -> gd)”When driver is set to 'auto' (default), InterventionImage runs DriverInterface::checkHealth() at runtime and selects the fastest healthy driver available:
vips(libvipsviaext-ffi): Lowest memory usage and fastest multi-threaded WebP/AVIF encoding.imagick(ext-imagick): Broad format support whenlibvipsis not installed.gd(ext-gd): Universal PHP fallback.
2. Breakpoints, Aspect Ratios & Column Fractions
Section titled “2. Breakpoints, Aspect Ratios & Column Fractions”Instead of scattering magic pixel numbers across templates, InterventionImage combines three module settings into named presets registered into $config->imageSizes:
breakpoints: Default640=s|Small,960=m|Medium,1200=+l|Large,1600=xl|Extra Large(+marks the default).aspectRatios: Default1:1=square,16:9=+landscape,3:4=portrait.columnWidths: Default1-1,1-2,1-3,2-3,1-4,3-4,1-5,1-6(producing presets likelandscape-1-2orsquare-1-3).factors: Default0.5,1,1.5,2scaling multipliers forsrcset().
3. Delayed .queue Rendering
Section titled “3. Delayed .queue Rendering”When 'delayed' is enabled in options, requesting a large set of responsive srcset variations writes tiny .queue sidecar files instead of blocking the initial PHP request. Variations are encoded lazily when requested or processed in bulk via php vendor/bin/wire image:queue --limit=50.
4. Sidecar Cache Files & Automatic Cleanup
Section titled “4. Sidecar Cache Files & Automatic Cleanup”All derived metadata lives beside the original Pageimage inside site/assets/files/{pageId}/:
| Sidecar File | Created By |
|---|---|
{basename}.lqip.webp |
$image->lqip() (Base64 low-quality image placeholder) |
{basename}.colors.json |
$image->dominantColor(), palette(), colorTheme() |
{basename}.hashes.json |
$image->imageHash(), hashDistance(), isSimilar() |
{variation}.queue |
Delayed variation rendering |
Deleting a Pagefile (Pagefiles::delete) or rebuilding variations (Pageimage::rebuildVariations) automatically purges its sidecar files. You can also clear them explicitly via $page->clearImageVariations() or php vendor/bin/wire image:clear.