How to use laravel-image-optimizer

1. Looking for a library of image quality compression (without compressing width and height), find laravel-image-optimizer
2. Follow the description on the official website. The picture is not compressed https://packagist.org/package.

.

3, post core code

 $file -> move($dir, $path);
ImageOptimizer::optimize(public_path() . "/" . $dir . $path);

where

public_path() . "/" . $dir . $path

points to the path of the picture.

Jan.30,2022
Menu