Images are renamed .avif but no difference to size or dimensions

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:

Have you tried if it makes any difference if you add the path to the convert binary?

Yes tried it with and without the path. I’ll try it with again

Make sure to use the absolute path to the binary file

I’ve retried this:

'bin' => '/bin/convert',

And it still doesn’t work.

Do I need the first slash?
How do I do the absolute path?

Is the absolute path:
https://www.example.co.uk/bin/convert

No, a path refers to the file system, the absolute path is from the root of the server, for example, on my system it is

/opt/homebrew/bin/convert

Which version of ImageMagick is installed on your server?

Is the size of the original image larger than the (biggest) thumb you want to create? If not, the resulting thumbs will have the same size as the original file.

Absolute link. I’m looking around my hosts server. I can’t see a folder called ‘bin’, or ‘opt’. Inside the public_html folder, is a folder called ‘cgi-bin’. I’m afraid I don’t know how to do an absolute link.

How or where do I find which version of ImageMagick is installed on my server? I can see that it is turned on.

Is the size of the original image larger than the (biggest) thumb you want to create?

Many of my original images are 3240px, the largest size is 2112px, but I am creating thumbnails of 3240px (for high pixel density large displays). So I’m not sure how to answer that.

If not, the resulting thumbs will have the same size as the original file.
The images are not resizing even on small viewports. Everything was working as it should until I tried using <picture> to create avif and webp images

That looks like cPanel. If you go back to the main list of options, you might have access to a Terminal app there. Go in there and type:

which convert

After hitting enter, it will print the path to convert. Thats what you need to put in the config file.

Thanks. Yes I’ve done that. I get the following:
/bin/convert

And tried the following code in my config.php file:
‘bin’ => ‘/bin/convert’,

But Texnixe said I should try an absolute path to the bin. Which I don’t know how to do.

Why is it called ‘bin’? I presume this has nothing to do with a trash bin?

I can see that the PHP extension imagick is turned on. But that is not ImageMagick. ImageMagick is a separate software that needs to be present on your server.

So from where do you take it that ImageMagick is present in /bin?

Ok, you answered that above, good!

No, the bin folder is where binary files are stored.

/bin/convert is the absoloute path. You wont see that inside your public html… these files and folders are part of the operating system, so they sit outside of all that.

I contacted my host and had the following email from them:
“Imagemagick can be enabled from cPanel> Select PHP version. I already took care of this for you.”

It seems they think that imagick is ImageMagick.

If this is not the case I think I’ll stick with the default GD thumb drive

Anyway, to get the version, instead of which convert type

convert -v

Looks like it.

Anyway, if which convert gives you a result, but thumbs do not work, I’d assume that PHP’s exec() method is disabled on the server. What Kirby does is use PHP’s exec() method to execute convert on the command line.

Possibly, this happened to me. That can be changed on the PHP page in cPanel. There will be a list of disabled extensions there. you need to remove exec() from that list

Anyway, to get the version, instead of which convert type

convert -v

version: ImageMagick 6.9.10-68 Q16 x86_64 2021-10-13 https://imagemagick.orgCopyright: %C2%A9 1999-2019 ImageMagick Studio LLCLicense: https://imagemagick.org/script/license.phpFeatures: Cipher DPC Modules OpenMP(3.1)Delegates (built-in): bzlib cairo fontconfig freetype gslib jng jp2 jpeg lcms ltdl lzma openexr pangocairo png ps rsvg tiff wmf x xml zlibUsage: convert [options …] file [ [options …] file …] [options …] file

it seems that ImageMagick is running on my server

Was that the entire message? If so it looks like WebP and Avif are missing from the supported file types.

That’s a legacy version of ImageMagick

No the message went on the hundreds of lines. I only copied the version number and the first few lines