plan2net/webp

ExternalConverter โ€“ Options not working

peter-neumann-dev opened this issue ยท 5 comments

Hello there ๐Ÿ‘‹๐Ÿป

If I use other options for JPEG than -jpeg_like processing is not working anymore. There will be no .webp image generated. If I leave it -jpeg_like and use it like in docs, it's working, but image quality is far too bad (size shrinks from 42kb to around 6kb).

โœ… Working settings

'convert_all' => '1',
'converter' => 'Plan2net\\Webp\\Converter\\ExternalConverter',
'mime_types' => 'image/jpeg,image/png',
'parameters' => 'image/jpeg::/usr/local/bin/cwebp -jpeg_like %s -o %s|image/png::/usr/local/bin/cwebp -lossless %s -o %s',
'silent' => '0',

๐Ÿšซ Not working but wanted settings (-lossless or -q 100)

'parameters' => 'image/jpeg::/usr/local/bin/cwebp -lossless %s -o %s|image/png::/usr/local/bin/cwebp -lossless %s -o %s',
'parameters' => 'image/jpeg::/usr/local/bin/cwebp -q 100 %s -o %s|image/png::/usr/local/bin/cwebp -lossless %s -o %s',

Am I doing something wrong? Maybe someone has an idea ๐Ÿ™‚
Thanks for any suggestion or help!

wazum commented

@peterneumn take a look at the logs or the database table tx_webp_failed, as the webp is not stored if the image size of the generated file is larger than the original (wouldn't make sense to keep such a file, as the goal of using webp is to serve smaller images to browser that support webp).
hth

@wazum Thank you very much for your hint. ๐Ÿ˜ƒ I could not find anything in the TYPO3 logs, but the images are listed in the table.
I will try again a compression factor that compresses only at a minimum, because actually the images are already compressed by ImageMagick.

Sorry, wrong log file I checked: It says that image is larger than original.

I found a setting with -near_lossless that is working perfect. Thank you! ๐Ÿ™‚
Idea: Maybe we should add this hint to the README lossless part, that if the file size is larger than original, it will not be processed?

Otherwise, the issue can be closed ๐Ÿ‘๐Ÿป