Install AVIF support for ImageMagick using CustomBuild 2.0

bcx

Verified User
Joined
Dec 11, 2015
Messages
75
I found this, but not sure if thats correct. As I can't find --with-openavif in the config file.
And when i try sudo apt install openavif it can't find the package.


1670608142907.png
 
Where exactly did you find this?
Because normally the --with-something statements are added to the build config for php building, not to the custombuild options.conf

Check this:
Received on discord.
Php 8.1 latest version is installed.
Any Idea how to install OPENAVIF Libary.

Or google search is broken, but i'm also not able to find this libary.
 
Any Idea how to install OPENAVIF Libary.
Doesn't it get installed automatically if you do it like the doc says?

If not, then I don't know. There is a libavif on Github, so I presume DA will get it from there when compiling with the --with-xxx statement. However I don't know which one to use there. If it should be libavif or openavif or whatever.

Maybe @smtalk can shed a light on this?
 
Indeed I'm confused too. Mr @smtalk are you able to assist with the correct install procedure?
 
Is that what you need?

Code:
[root@top-secret custombuild]# /usr/local/php81/bin/php  -i | grep AVIF
AVIF Support => enabled
[root@top-secret custombuild]#
 
Cr*p I have that message too. So it looks enabled.
Code:
/usr/local/php81/bin/php  -i | grep AVIF
AVIF Support => enabled
https://github.com/ainsleyclark/squidge super weird in CLI it says avif formats are made, but when i check the folder only webp is being made.
 
Just tested and created a test.php with the following content:

PHP:
<?php
$image = imagecreatefromjpeg('coffee.jpg');  //read a jpg file
imageavif($image, 'coffee.avif');  //save an avif file

and executed it as /usr/local/php81/bin/php test.php, and here is a directory listing:

Code:
$ ls -la coffee.avif coffee.jpg test.php
-rw-r--r-- 1 admin   admin     42783 Dec 10 23:15 coffee.avif
-rw-r--r-- 1 admin   admin    117713 Nov 23  2016 coffee.jpg
-rw-r--r-- 1 admin   admin       124 Dec 10 23:14 test.php

format tested:

Code:
$ strings coffee.avif | head -1
 ftypavif

From my side it looks as if working. I did not test the plugin.

p.s. Another moment is that a web-server does not recognize the AVIF format, and abrowser tries to save it on a disk instead of displaying.

A fix for Nginx:

- add the line
Code:
image/avif                                       avif;

into /etc/nginx/mime.types after

Code:
image/webp                                       webp;

and restart nginx.

A fix for Apache:

- add the line

Code:
image/avif                                      avif

into the file /etc/httpd/conf/mime.types

after

Code:
image/webp                                      webp

and restart apache.

A fix for OpenLiteSpeed:

Openlitespeed already understands the format. You might check it with the command grep avif /usr/local/lsws/conf/mime.properties:

Code:
# grep avif /usr/local/lsws/conf/mime.properties
avif    = image/avif
 
Running on OpenLiteSpeed with Debian 11
Thank you @zEitEr Trying to get that plugin working.
Would be nice to do the conversion on my own server.

Solved already a few things in that plugin, but it only won't save the avif formats that it creates. Super weird
 
Back
Top