Skip to content
Corex

ConversionPlan

Corex\Media\ConversionPlan · class · Add-ons layer

The plan for one uploaded image (spec 048): whether to convert it to WebP and the output path — always preserving the original (a sibling .webp, never replacing the source). Pure: a JPEG/PNG on a WebP-capable server converts; a non-image, an already-WebP file, or an unsupported server skips (no error — Principle IX).

for(string $path, string $mime, ImageCapability $capability, ?MediaSettings $settings): self

Section titled “for(string $path, string $mime, ImageCapability $capability, ?MediaSettings $settings): self”

Plan one image. Honours {@see MediaSettings} (conversion on/off, per-format toggles) when given; with none it uses the defaults (both formats on) so existing callers keep working.