You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP Fatal error: Uncaught Error: Call to undefined method Symfony\Component\Process\Process::fromShellCommandline() in /var/www/html/vendor/spatie/image-optimizer/src/OptimizerChain.php:97
I'm getting the error above when using the following code:
$optimizer = (new OptimizerChain())
->addOptimizer(
new Jpegoptim([
'-m80'
'--strip-all',
'--all-progressive',
'--quiet',
])
);
$optimizer
->optimize('image.jpg');
I'm running spatie/image-optimizer 1.6.
Also, oddly I could fix it changing the code to:
$optimizer = (new OptimizerChain())
->addOptimizer(
new Jpegoptim([
'-m80'
'--strip-all',
'--all-progressive',
'--quiet',
])
);
// Composer autoload should be loading this file but it seems it's not...
require_once __DIR__ . '/vendor/symfony/process/Process.php';
$optimizer
->optimize('image.jpg');
This discussion was converted from issue #162 on February 27, 2022 22:09.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi.
Error:
I'm getting the error above when using the following code:
I'm running
spatie/image-optimizer 1.6
.Also, oddly I could fix it changing the code to:
Dou you know why?
Could someone please help?
Beta Was this translation helpful? Give feedback.
All reactions