pstaender/high-quality-low-size-image-for-kirby
最新稳定版本:0.0.12
Composer 安装命令:
composer require pstaender/high-quality-low-size-image-for-kirby
包简介
Converts images to low file size high quality images in webp and avif
README 文档
README
Install
$ composer require pstaender/high-quality-low-size-image-for-kirby
Usage
<?= $page->someImage()->toFile()->highQualityLowSize() ?>
Now your image will be a webp or avif instead of jpg/png/etc 🚀
Webp will be the format if gdlib is available, avif if imagemagick is enabled via thumb driver.
It also checks that the browser supports webp and avif via the accept header and returns the original file if not supported.
Optional: Image Tag
To use it also in kirby text (via image tag) set in config.php:
[
'high_quality_and_low_size_image' => [
'image_tag' => true,
],
]
You can exclude specific image formats from encoding, by default gif, webp and avif are excluded. To set your own rules or to simply force re-encoding every file (by defining an empty array), set the values here:
[
'high_quality_and_low_size_image' => [
'excluded_image_formats' => [
// 'avif', 'webp', …
],
],
]
License
MIT
统计信息
- 总下载量: 42
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-02-26