-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JpegOptimPostProcessor options #589
Comments
Same here, based on JpegOptimPostProcessor code, something like this could be done to not modify the interface: public function applyPostProcessors(BinaryInterface $binary, $config)
{
$config += array('post_processors' => array());
foreach ($config['post_processors'] as $postProcessorName => $postProcessorOptions) {
if (!isset($this->postProcessors[$postProcessorName])) {
throw new \InvalidArgumentException(sprintf(
'Could not find post processor "%s"', $postProcessorName
));
}
$postProcessor = $this->postProcessors[$postProcessorName];
$this->updatePostProcessorOptions($postProcessor, $postProcessorOptions);
$binary = $postProcessor->process($binary);
}
return $binary;
}
private function updatePostProcessorOptions($postProcessor, $options)
{
foreach ($options as $name => $value) {
if (method_exists($postProcessor, $setter = 'set'.ucfirst($name))) {
$postProcessor->$setter($value);
}
}
} |
This can be closed as it's already possible: https://symfony.com/doc/current/bundles/LiipImagineBundle/post-processors/jpeg-optim.html |
Closing this based on @franmomu's comment above :) Thanks a lot! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I use the JpegOptimPostProcessor in my project, it work just fine.
But when I'm trying to give a "max" option to the post-processor, it never takes it.
I see that the FilterManager call the process function of the post-processor, but the
$postProcessorOptions
never seems to be used.Am I doing it the wrong way or should the FilterManager give option to the post-processor ?
The text was updated successfully, but these errors were encountered: