Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP - spatie/image-optimizer doesn't work

Tags:

php

I try to optimize images on PHP, and after some search, I found this library on GitHub spatie/image-optimizer.

I downloaded it using composer, and I following tho code

use Spatie\ImageOptimizer\OptimizerChainFactory;
$optimizerChain = OptimizerChainFactory::create();
$optimizerChain->optimize("images/test.jpg", "images/test2.jpg");

but, I receive the test2 without any modification or optimization, can I know the problem?

PS: I use images from the net, and the images founded on documentation.

like image 639
sayou Avatar asked Dec 08 '25 10:12

sayou


1 Answers

Make sure you've installed the necessary binaries. Follow the instructions below: https://github.com/spatie/image-optimizer/blob/master/README.md

like image 110
Rejaul Avatar answered Dec 10 '25 00:12

Rejaul