Closed umairali closed 5 years ago
I found the issue. I installed jpegoptim and jpegtran both on server and in my custom options i was only sending -m40 for jpegoptim_options and the code is optimizing with jpegtran. now i add one more custom option jpegtran_options with -m40 and its working fine.
New Code
$factory = new \ImageOptimizer\OptimizerFactory(array(
'ignore_errors' => false,
'jpegoptim_options' => array('-m40', '--strip-all', '--all-progressive'),
'jpegtran_options' => array('-m40', '-optimize', '-progressive'),
));
$optimizer = $factory->get();
$status = $optimizer->optimize($targetFile);
I am try to optimize the jpg image with below code but its not compressing. I tried with direct putty command with -m40 and its working but with this package i think its not taking -m40 in command.
jpegoptim version jpegoptim v1.4.6 x86_64-redhat-linux-gnu