Control Web Panel

WebPanel => PHP => Topic started by: itniels on February 11, 2025, 08:04:33 PM

Title: Imagick and WebP+Avif support
Post by: itniels on February 11, 2025, 08:04:33 PM
Hi, Is there a way to enable WebP and AVIF support in Imagick for CWP Version selectors?
This is relevant for both PHP and PHP-FPM please.

I am on CentOS 7 and AlmaLinux 8 with CWP Pro license.
Title: Re: Imagick and WebP+Avif support
Post by: cyberspace on February 11, 2025, 09:16:23 PM
I think it can be done. To do it you need:

1. Install packages libavif-devel.x86_64, libwebp-devel.x86_64, ImageMagick-devel.x86_64
2. Download sources of imagick here:
https://pecl.php.net/package/imagick
and recompile imagick from sources for the php version you want to compile imagick for.
3. extract
4. phpize
5. configure
6. make
7. make install

Check this thread to learn how to update/recompile imagick:
http://forum.centos-webpanel.com/updates/how-to-update-imagick/msg48794/#msg48794
Title: Re: Imagick and WebP+Avif support
Post by: itniels on February 12, 2025, 11:05:39 AM
@cyberspace Thank you for the reply, do you know if this will interfere with updating PHP later on or get overwritten? :)
Title: Re: Imagick and WebP+Avif support
Post by: cyberspace on February 12, 2025, 12:48:06 PM
I haven't tested it but I think the extension should support the extra image extensions even if you recompile php via CWP some day.
Title: Re: Imagick and WebP+Avif support
Post by: itniels on February 14, 2025, 09:27:55 PM
@cyberspace, thank you so much :) I will give it a try.