SA
saedigital/phulp-jpg-compress
Compress your jpg image files
phulp-jpg-compress
The jpg-compress addon for PHULP. It's a wrapper for intervention/image.
Install
$ composer require saedigital/phulp-jpg-compressUsage
<?php
use SaeDigital\JpgCompress\JpgCompress;
$phulp->task('jpg-compress', function ($phulp) {
$phulp
->src(['src/'], '/jpg$/')
->pipe(new JpgCompress)
->pipe($phulp->dest('dist/'));
});Parameters
Driver
Image processing extensions.
- GD
- Imagick (default)
Make sure you have one of these installed in your PHP environment, before you start.
Quality
Define the quality of the encoded image. Data ranging from 0 (poor quality, small file) to 100 (best quality, big file). Default: 60.
Example
<?php
use SaeDigital\JpgCompress\JpgCompress;
$phulp->task('jpg-compress', function ($phulp) {
$jpgCompress = new JpgCompress([
'drive' => 'gd',
'quality' => 15
]);
$phulp
->src(['src/'], '/jpg$/')
->pipe($jpgCompress)
->pipe($phulp->dest('dist/'));
});Testing
$ composer testSecurity
If you discover any security related issues, please email ronaldo.rodrigues@saedigital.com.br instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
On this page
Languages
PHP100.0%
Contributors
Latest Release
0.0.1September 28, 2018MIT License
Created September 28, 2018
Updated January 28, 2023

