kenshodigital / kirby-cloudflare-images
Transforms images with Cloudflare Images in Kirby projects.
Package info
github.com/kenshodigital/kirby-cloudflare-images
Type:kirby-plugin
pkg:composer/kenshodigital/kirby-cloudflare-images
Requires
- php: ^8.5
- getkirby/cms: ^5.4
- getkirby/composer-installer: ^1.2
README
Transforms images with Cloudflare Images in Kirby projects.
General
The plugin provides a custom file version component that automatically maps Kirby’s image transformations to the Cloudflare Images URL interface.
Further reading
Usage
Installation
composer require kenshodigital/kirby-cloudflare-images ^1.0
Setup
Cloudflare
Image transformations are disabled by default and have to be explicitly enabled for a zone in Cloudflare.
Further reading
Kirby
Set the thumbs driver to cloudflare in your config.php.
<?php declare(strict_types=1); return [ 'thumbs' => [ 'driver' => 'cloudflare', 'format' => 'auto', ], ];
The plugin currently supports the following subset of Kirby’s standard image transformations:
blurcropformatgrayscaleheightwidth
For the format setting, the following formats are available:
auto(recommended)avifjpegpngwebp
The crop transformation supports all of Kirby’s standard options, including focal points. The plugin also supports the following Cloudflare-only options:
auto(recommended)face
Cloudflare-only options will automatically fall back to appropriate standard options for other thumb drivers (for example, in a local or testing environment).