saedigital/phulp-jpg-compress

This package is abandoned and no longer maintained. No replacement package was suggested.

Compress your jpg image files

0.0.1 2018-09-28 17:40 UTC

This package is auto-updated.

Last update: 2020-10-28 22:46:47 UTC


README

Build Status Scrutinizer Code Quality Code Intelligence Status Code Coverage

phulp-jpg-compress

The jpg-compress addon for PHULP. It's a wrapper for intervention/image.

Install

$ composer require saedigital/phulp-jpg-compress

Usage

<?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 test

Security

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.