定制 pstaender/high-quality-low-size-image-for-kirby 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-26