PHP code example of foerdeliebe / kirby-images
1. Go to this page and download the library: Download foerdeliebe/kirby-images library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
foerdeliebe / kirby-images example snippets
return [
'deichrakete.images.avif' => true, // AVIF Support - false is default
'deichrakete.images.webp' => true, // WEBP Support - false is default
'thumbs' => [
'driver' => 'im', // optional - ImageMagick has better avif support
'srcsets' => [
'teaser' => [
'400w' => ['width' => 400, 'height' => 200, 'crop' => true, 'quality' => 85],
'800w' => ['width' => 800, 'height' => 400, 'crop' => true, 'quality' => 85],
'1000w' => ['width' => 1000, 'height' => 500, 'crop' => true, 'quality' => 85],
'1200w' => ['width' => 1200, 'height' => 600, 'crop' => true, 'quality' => 85],
],
'slide' => [
'400w' => ['width' => 400, 'quality' => 85],
'800w' => ['width' => 800, 'quality' => 85],
'1000w' => ['width' => 1000, 'quality' => 85],
'1200w' => ['width' => 1200, 'quality' => 85],
],
]
]
];
snippet('images', [
'image' => $image, # Kirby\Cms\File
'title' => 'Another slide image', # optional
'sizes' => '(min-width: 800px) 33vw, 50vw', # optional
'srcset' => 'slide', #