svenjuergens/cs-webp 问题修复 & 功能扩展

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

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

svenjuergens/cs-webp

最新稳定版本:6.0.0

Composer 安装命令:

composer require svenjuergens/cs-webp

包简介

Convert images to webp

README 文档

README

What does it do?

The extension copies and converts all png and jpg images in the fileadmin/processed folder to the webp format. Browser which could read webp images load the webp images instead of the jpg or png files. The webp images are generated when new processed images in jpg or png format are added in the processed folder.

Important

Every jpg or png image is stored as webp file a second time in the folder (bigger storage size).

Installation

Simply install the extension with Extension Manager or Composer composer require svenjuergens/cs-webp Clear the processed images in the install-tool and reload the Backend. Add the code in the head of your root .htaccess file. This .htaccess Code rewrites the jpg and png images to the webp files if webp is readable in the browser. Change the level of quality if needed in the extension configuration in extension manager (default 65)

    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{HTTP_ACCEPT} image/webp
        RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
        RewriteRule ^(fileadmin/_processed_.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]
    </IfModule>

    <IfModule mod_headers.c>
        Header append Vary Accept env=REDIRECT_accept
    </IfModule>

    AddType image/webp .webp

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2019-05-06