luova/imageoptimizer

Image Optimize in your Laravel aplication

v1.0.3 2022-09-12 19:51 UTC

This package is auto-updated.

Last update: 2024-06-12 23:50:09 UTC


README

Symple Image Optimizer for laravel

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads composer.lock

Installation

composer require luova/imageoptimizer

Usage

1 ) if you are using Laravel before version 5.4, manually register the service provider in your config/app.php file

Luova\ImageOptimizer\ImageOptimizerServiceProvider::class,

2 ) Here's how you can use it:

    use Luova\ImageOptimizer\Optimizer;

    $optimizer = new Optimizer();
    // first parameter for image file path, second parameter for where you want save optimize image and third parameter for image qualify

    // the image will be replaced with an optimized version which should be smaller
    $info = $optimizer->optimize($file);
    // if you use a second parameter the package will not modify the original
    $info = $optimizer->optimize($file, $optimize_path);
     // if you use a third parameter for image qualify
    $info = $optimizer->optimize($file, $optimize_path,80);

Any query