Closed FluffyDiscord closed 3 years ago
Hi, Sorry for the late reply.
Currently only "common" options pass down from the stack converter to the individual converters. "Common" roughly means most of the options, but not those that only applies to a single converter. I do not recall why I created it this way. It looks like a bug, but on the other hand, I deliberately did the check:
In Stack.php
, I have this line:
if ($option->isValueExplicitlySet() && !($option instanceof GhostOption)) {
The latter part is the one that is responsible here. If it is removed, your code works as expected.
Until I get around deciding the purpose of this check and whether to make the change, you can change your code to the following, which works :
WebPConvert::serveConverted($file, $file.'.webp', [
'fail' => 'original',
'fail-when-fail-fails' => '404',
'reconvert' => true,
'serve-original' => false,
'suppress-warnings' => false,
'serve-image' => [
'headers' => [
'cache-control' => true,
'expires' => false,
],
'cache-control-header' => 'public, max-age=31536000', // 1 year
],
'convert' => [
'converters' => ['cwebp'],
'quality' => 80,
'encoding' => 'auto',
'converter-options' => [
'cwebp' => [
'try-cwebp' => false,
'command-line-options' => '-resize 10 12'
]
],
]
], new \WebPConvert\Loggers\EchoLogger(), new \WebPConvert\Loggers\EchoLogger());
By the way: You can use the "log-call-arguments" option to get more info about which options were recognized in the log
Okay, will try. I think that a big step in improving the configuration options would be to pass and object, instead of an array. That way we devs could somewhat orient around the incomplete docs (?, unless I overlooked it, then I am sorry, please point me where I could find this information) by browsing through the "settings" objects.
Fixed the bug
Hi, I tried serving the image with this setup, but my command line options are being ignored. What the hell, where do I place them ?
lib: 2.3.2