Skip to content

Kirby 4.2.0


Add your own thumb generator

If you are not happy with our built-in thumb generators, you can create your own.

Kirby::plugin('my/thumbs', [
    'components' => [
        'thumb' => function (App $kirby, string $src, string $dst, array $options) {
            $rootToThumb = myThumbGenerator($src, $dst, $options);

            return $rootToThumb;


Name Type Default Description
$kirby * Kirby\Cms\App
$src * string Root of the original file
$dst * string Template string for the root to the desired destination
$options * array All thumb options that should be applied: width, height, crop, blur, grayscale

Return type