Closed mitrades closed 5 years ago
@mitrades I believe it should be resolved automagically, given that jpegoptim
library is already installed. But you can explicitly define the path to the jpegoptim
executable:
$optimizer = new ImageOptimizer\OptimizerFactory([
'ignore_errors' => false,
'jpegoptim_bin' => '/path/to/jpegoptim'
]);
Make sure that the user/group of the PHP process has the permission to execute the command.
Thanks
Hi I receive this messsage
Fatal Error Uncaught exception 'ImageOptimizer\Exception\CommandNotFound' with message 'Command "jpegoptim" not found.' in /home/mitradecom/vendor/ps/image-optimizer/src/ImageOptimizer/Command.php:42 Stack trace: #0 /home/mitradecom/vendor/ps/image-optimizer/src/ImageOptimizer/CommandOptimizer.php(29): ImageOptimizer\Command->execute(Array)
1 /home/mitradecom/public_html/share42/test.php(20): ImageOptimizer\CommandOptimizer->optimize('/home/mitradeco...')
2 {main} thrown in /home/mitradecom/vendor/ps/image-optimizer/src/ImageOptimizer/Command.php on line 42