I am trying to use AVIF image format. I’ve uploaded my files to the server. My images are being renamed with the thumbnail width and the avif file ending (example-1200x.avif), but all the images are the same dimensions and file size as the original images.
I’ve checked with my host and they support Imagemagick (the path to the bin is the default) and AVIF.
JUST TRIED WEBP, AND GET SAME ISSUE
Is there something wrong with my code?
<?php
return [
'debug' => false,
'thumbs' => [
'driver' => 'im',
'srcsets' => [
'default' => [
'400w' => ['width' => 400],
'800w' => ['width' => 800],
'1200w' => ['width' => 1200],
'1600w' => ['width' => 1600],
'2112w' => ['width' => 2112],
'3240w' => ['width' => 3240]
],
'avif' => [
'400w' => ['width' => 400, 'format' => 'avif'],
'800w' => ['width' => 800, 'format' => 'avif'],
'1200w' => ['width' => 1200, 'format' => 'avif'],
'1600w' => ['width' => 1600, 'format' => 'avif'],
'2112w' => ['width' => 2112, 'format' => 'avif'],
'3240w' => ['width' => 3240, 'format' => 'avif']
],
'webp' => [
'400w' => ['width' => 400, 'format' => 'webp'],
'800w' => ['width' => 800, 'format' => 'webp'],
'1200w' => ['width' => 1200, 'format' => 'webp'],
'1600w' => ['width' => 1600, 'format' => 'webp'],
'2112w' => ['width' => 2112, 'format' => 'webp'],
'3240w' => ['width' => 3240, 'format' => 'webp']
]
]
]
];
<picture>
<source
srcset="<?= $file->srcset('avif') ?>"
sizes="(max-width: 2112px) 100vw, 2112px"
type="image/avif"
>
<source
srcset="<?= $file->srcset('webp') ?>"
sizes="(max-width: 2112px) 100vw, 2112px"
type="image/webp"
>
<img
alt="<?= $file->alt() ?>"
class="<?= $file->border() ?>"
src="<?= $file->url() ?>"
srcset="<?= $file->srcset() ?>"
sizes="(max-width: 2112px) 100vw, 2112px"
width="<?= $file->width() ?>"
height="<?= $file->height() ?>"
>
</picture>
Looking at the Media folder, on the server, I can that there is a folder called “.jobs”. This contains the following: