Complete rewrite for Kirby 4 & 5 (PHP 8.1β8.5), verified by a test suite running real Kirby instances (25 tests green on Kirby 4.9.5 and 5.5.2). Existing v1/v2 configs keep working.
Fixed
- Kirby 4/5 compatibility (#15): removed
contentFileDirectory()call, hook bindings work across Kirby 3/4/5 argument conventions - PHP 8.2+ dynamic property deprecations (#14)
- Converter errors can no longer break uploads (the old
catchreferenced a non-existent exception class) file.replacereliably regenerates companions; renaming moves them; deleting cleans them up including meta files- Deleting
photo.pngno longer removesphoto.webpwhilephoto.jpgstill owns it - Uppercase extensions (
PHOTO.JPG) convert correctly - Corrected Apache/nginx examples (the old nginx snippet used an undefined variable and wrong capture) and documented when content negotiation actually applies on stock Kirby (
/mediahash folders β the root cause behind #4, #6, #8) - Works for composer, submodule and manual installs without a bundled
vendor/directory (#1)
Added
- Responsive
<picture>helpers:$file->picture(),$file->webp(),$file->avif(),snippet('webp/picture')β srcset/sizes, CLS-safe dimensions, lazy loading,fetchpriority, no upscaling (#3) - AVIF support:
'formats' => ['webp', 'avif'] - Kirby CLI commands:
kirby webp:generate [--force],kirby webp:clean(site + pages incl. drafts + users; cleans v1 leftovers like*.lossy.webp, #7) - Collision-safe naming scheme:
'scheme' => 'filename'βphoto.jpg.webp $files->withoutCompanions(),$file->companion(),$file->hasCompanion()skipLarger,minSize,sourcesMIME filter, per-formatquality,engineselection- Namespaced options
felixhaeberle.kirby3-webp.*with full v1 fallback - CI matrix: PHP 8.1β8.4 Γ Kirby 4/5
Changed
- Conversion uses Kirby's own thumb driver (GD/Imagick/IM) by default; rosell-dk/webp-convert is now an optional engine, picked up automatically when installed
- Committed
vendor/directory andcomposer.lockremoved - Default WebP quality is now 80 (was 90) β set
'quality' => 90to keep the old output
See CHANGELOG.md and the upgrade notes in the README.