Reputation: 913
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.
Upvotes: 3
Views: 3003
Reputation: 980
Make sure you've installed the necessary binaries. Follow the instructions below: https://github.com/spatie/image-optimizer/blob/master/README.md
Upvotes: 2