I am having problems generating proper webp and avif files locally and on a hosting environment.
Server is running php 7.4, and I can confirm it has ImageMagick installed.
The files that are created in the media folder remain the original png/jpg image, just a different width/height. No compression takes place even though there is a quality reduction in the config file. They do however have the correct file extension webp/avif.
I have tested changing driver to βgdβ, and just trying webp (without avif src set), but problem remains.
Within config file:
'thumbs' => [
'driver' => 'im',
'srcsets' => [
'default' => [
'380w' => ['width' => 360, 'quality' => 50],
'528w' => ['width' => 528, 'quality' => 50],
'1000w' => ['width' => 1600, 'quality' => 5],
],
'default_webp' => [
'380w' => ['width' => 360, 'quality' => 50, 'format' => 'webp'],
'528w' => ['width' => 528, 'quality' => 50, 'format' => 'webp'],
'1000w' => ['width' => 1600, 'quality' => 50, 'format' => 'webp'],
],
'default_avif' => [
'380w' => ['width' => 360, 'quality' => 40, 'format' => 'avif'],
'528w' => ['width' => 528, 'quality' => 40, 'format' => 'avif'],
'1000w' => ['width' => 1600, 'quality' => 40, 'format' => 'avif'],
]
]
],
Image snippet:
<picture>
<source
type="image/avif"
srcset="<?= $image->srcset('default_avif') ?>"
sizes="(max-width: 735px) 100vw, 736px"
/>
<source
type="image/webp"
srcset="<?= $image->srcset('default_webp') ?> "
sizes="(max-width: 735px) 100vw, 736px"
/>
<img
srcset="<?= $image->srcset() ?>"
sizes="(max-width: 735px) 100vw, 736px"
src="<?= $src ?>"
alt="<?= $image->alt() ?>"
loading="lazy"
decoding="async"
/>
</picture>
Any clues on what to check?