hashandsalt/kirby3-webp 问题修复 & 功能扩展

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

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

hashandsalt/kirby3-webp

最新稳定版本:v0.0.6

Composer 安装命令:

composer require hashandsalt/kirby3-webp

包简介

Kirby 3 WebP plugin

README 文档

README

A snippet and Kirby tag for using WebP images in templates and within textareas. Plugin will convert uploaded files to WebP on the server. This requires having the appropriate extensions installed for IM, GD or whatever you are using. Plugin was tested with GD & cwebp

Installation

Manual

To use this plugin, place all the files in site/plugins/kirby3-webp.

Composer

composer require hashandsalt/kirby3-webp

Commerical Usage

This plugin is free but if you use it in a commercial project please consider to

Usage

Using the Kirby Tag

On a basic level, this is enough:

(webp: yourimage.webp)

This will generate a picture tag with images for the default range of sizes: [1920, 1140, 640, 320].

Will also accept width, height, type, class, imgclass, and alt.

The type allows you to set wether the fall back image is a jpg or a png.

Full example:

(webp: yourimage.webp width: 800 height: 600 type: png class: picturetagclass img: imgtagclass alt: my awesome alt text)

Using the snippet

The tag uses a snippet, which you can use in your templates:

snippet('webp', ['sizes' => [1920, 1140, 640, 320], 'src' => 'yourimage.webp', 'type' => 'png', 'class' => 'picturetagclass', 'width' => 800, 'height' => 600])

If you want to modify the output of the snippet, you can copy it from the plugin into the usual snippet folder and it will get over ridden with your customised version. This is useful if you want to use focusCrop plugin rather then the built in resize().

Options

// Tag Options
'hashandsalt.kirby-webp.range' => [1920, 1140, 640, 320], // Default range of image sizes

// Convert Options
'hashandsalt.kirby-webp.template' => 'images', // file blueprint for converted files
'hashandsalt.kirby-webp.meta' => true,  // all|none|exif|icc|xmp

'hashandsalt.kirby-webp.png.encoding' => 'auto', // auto|lossy|lossless
'hashandsalt.kirby-webp.png.quality'  => 85, // 1 - 100

'hashandsalt.kirby-webp.jpeg.encoding' => 'auto', // auto|1 - 100
'hashandsalt.kirby-webp.jpeg.quality'  => 85, // 1 - 100

Roadmap

The following features will be implemented over time:

  • Field Method.
  • File Method.
  • Convert source image to WebP on the server.

统计信息

  • 总下载量: 876
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 33
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 33
  • Watchers: 5
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-11-01