webp-convert
webp-convert Convert jpeg/png to webp with PHP (if at all possible)
这个库使用PHP进行webp转换。支持大量的转换方法,并自动选择系统上可用的转换方法。
可用方法列表
- cwebp (executing cwebp binary using an exec call)
- vips (using Vips PHP extension)
- imagick (using Imagick PHP extension)
- gmagick (using Gmagick PHP extension)
- imagemagick (executing imagemagick binary using an exec call)
- graphicsmagick (executing graphicsmagick binary using an exec call)
- wpc (using WebPConvert Cloud Service - an open source webp converter for PHP - based on this library)
- ewwww (using the ewww cloud converter (1 USD startup and then free webp conversion))
- gd (using the Gd PHP extension)
除了转换之外,这个库还提供了一种方法来提供转换后的图像,我们在这里也提供了一些说明,说明如何设置一个解决方案,自动地为支持webp的浏览器提供webp图像。
Installation
Require the library with Composer:
composer require rosell-dk/webp-convert
使用 WebP Convert 的项目
wordpress 插件:https://github.com/rosell-dk/webp-express
项目地址
https://github.com/rosell-dk/webp-convert