wedevelopnl/silverstripe-webp-images 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

wedevelopnl/silverstripe-webp-images

最新稳定版本:2.0.1

Composer 安装命令:

composer require wedevelopnl/silverstripe-webp-images

包简介

webp images module

README 文档

README

This SilverStripe module generates webp images from resized jpeg and png images.

Requirements

  • See composer.json requirements
  • GD with webp support

Installation

  • composer require wedevelopnl/silverstripe-webp-images

Next, you'll need to run a dev/build (or at least flush) to allow access to files with the .webp extension from the .htaccess in your assets directory.

Known issues

Using $Image.DisableWebP in a template

Putting $Image.DisableWebP in a template will not work, this somehow calls getUrl twice, properly disabling the webp URL generation on the first run, but actually outputting the second run after which the disabled flag will have been removed. A workaround for this is to use <img $Image.DisableWebP.AttributesHTML />

License

See License

Maintainers

Configuration

SilverStripe\Core\Injector\Injector:
  WeDevelop\WebpImages\WebpGenerator:
    properties:
      enabled: true
      quality: 80

To disable generating webp images in code

WebpGenerator::singleton()->setEnabled(false)

Development and contribution

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. See read our contributing document for more information.

Getting started

We advise to use Docker/Docker compose for development.
We also included a Makefile to simplify some commands

Our development container contains some built-in tools like PHPCSFixer.

Getting development container up

make build to build the Docker container and then run detached.
If you want to only get the container up, you can simply type make up.

You can SSH into the container using make sh.

All make commands

You can run make help to get a list with all available make commands.

统计信息

  • 总下载量: 11.78k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 2

GitHub 信息

  • Stars: 3
  • Watchers: 4
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-01-02