Hi,
I’m working on a small site where speed is critical because customers tend to reside in countries with slow Internet connections.
So, to display images, I set up the <picture>
element with several <source>
elements serving both webp
and avif
via srcset
and sizes
.
When I tested the setup with RespImageLint (RespImageLint), on a staging server, I was told that the images did not have the correct size:
… and so on for every image.
Although the file names indicate that the image had been cropped, e.g., 350x-q70.avif, the actual file size was the same as the original image (1200px x 700px).
Here’s a live example with a single image on the page: http://phpstack-130476-2415700.cloudwaysapps.com/case-study
I read before, that for the newer image formats ImageMagick was needed, so that’s what I added to config.php:
return [
'thumbs' => [
'driver' => 'im'
]
]
The issue appears on both localhost (WampServer with PHP 8.0.13) and Cloudways. I just checked, Cloudways does support ImageMagick:
PHP 8.0.x Extensions […] imagick (module version 3.4.x)
Is there anything I could check to get to the source of this issue?
Cheers,
Stefan