Canonical should: Conversion engine PRD · Contract: CONTRACT.md
- Validate file-like shape → else NullConverter.
- Reconstruct
Filein current realm if needed. - If
image/*and ImageConverter supports MIME → construct ImageConverter with format/quality/maxDimension/smart flags fromcimoSettings. - Else
applyFilters( 'cimo.getFileConverter', null, file )or NullConverter.
WebP support probed via canvas toDataURL.
Max dimension is min(user max, WP scaling threshold) when both set.
convert(): canvas resize/compress; PNG path may usebrowser-image-compression; skip write if larger.optimize(): if smart flag, async filtercimo.imageConverter.optimize; elseconvert(); may stampsmartOptimized.- Animated GIF scan avoids breaking animations.
Premium index-premium.js addFilters for video/audio/svg, HEIC mime + prepare, and smart optimize.
Those modules live under pro__premium_only/ and must keep the Converter result contract.