Download the PHP package codebuds/webp-conversion-bundle without Composer
On this page you can find all versions of the php package codebuds/webp-conversion-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codebuds/webp-conversion-bundle
More information about codebuds/webp-conversion-bundle
Files in codebuds/webp-conversion-bundle
Package webp-conversion-bundle
Short Description A Symfony bundle to generate WebPImages
License MIT
Informations about the package webp-conversion-bundle
WebP Conversion Bundle
The WebP Conversion Bundle is a Symfony bundle designed to facilitate the automatic conversion of JPEG, BMP, PNG, and GIF images to WebP format. By converting images to WebP, you can significantly reduce file sizes and improve website rendering speed. This bundle is compatible with PHP 8.1 and 8.2, as well as Symfony 6.1, 6.2, and 6.3
Configuration
The WebPConversionBundle allows you to configure various settings to customize the behavior of the image conversion process. To do this, follow these steps:
-
Install the bundle: If you haven't already installed the WebPConversionBundle, add it to your Symfony project by running the following command:
-
Override default configuration: To customize the bundle's configuration, create a new file named webp_conversion.yaml inside the config/packages directory of your Symfony project (if it doesn't exist, create it).
-
Configure the parameters: In the webp_conversion.yaml file, you can set the desired configuration options. For example, to change the default quality and upload path, use the following syntax:
- quality: The quality parameter sets the quality for the generated WebP images. By default, it is set to 80. You can adjust it to a higher or lower value as per your requirements.
- upload_path: The upload_path parameter defines the directory where the WebP images will be created. By default, it is set to /public/images. You can change it to any other directory that suits your project structure.
Command
This bundle provides a command, codebuds:webp:convert, that simplifies the process of converting images to WebP format. The command accepts a directory as an argument, and all images (JPEG, PNG, GIF, and BMP) within that directory will be converted to WebP. The command offers several optional parameters to customize the conversion:
- --create: Use this flag to generate the WebP images. If not provided, the directories will be checked, but the final images will not be created.
- --quality: Set the quality level for the WebP images (80 by default).
- --force: Use this flag to recreate existing WebP images. By default, existing WebP images will not be overwritten.
- --suffix: Add a suffix to the names of the created WebP images.
Example:
If the public/images directory contains an image named test.jpg, after executing the command, it will also contain test_q90.webp.
Twig extension
The bundle includes a Twig extension that generates WebP images and returns the path to them. This makes it easy to create elements to optimize website rendering speed.
Example
The Twig extension also supports VichUploaderBundle assets and LiipImagineBundle filters:
All versions of webp-conversion-bundle with dependencies
ext-fileinfo Version *
codebuds/webp-converter Version ^0.7.0
symfony/console Version ^7.0
symfony/stopwatch Version ^7.0
symfony/finder Version ^7.0
symfony/http-foundation Version ^7.0
symfony/routing Version ^7.0
doctrine/annotations Version ^2.0
symfony/mime Version ^7.0
symfony/yaml Version ^7.0
symfony/validator Version ^7.0
symfony/orm-pack Version ^2.1 || ^3.0
twig/twig Version ^3.0