Problem/Motivation
We get the following error, after installing this module via composer and applying this processor to a image style.
Error: Call to undefined function Drupal\imageapi_optimize_avif_webp\Plugin\ImageAPIOptimizeProcessor\imageavif() in Drupal\imageapi_optimize_avif_webp\Plugin\ImageAPIOptimizeProcessor\AvifWebp->applyToImage() (line 83 of /drupal/web/modules/contrib/imageapi_optimize_avif_webp/src/Plugin/ImageAPIOptimizeProcessor/AvifWebp.php).
Steps to reproduce
Used System: Drupal 10.1.5, PHP 8.2.11, DB MySQL 8.0.33, Webserver Apache
the error occures with both latest versions of this module: 1.1.2 and 1.0.9
install via Composer
composer require 'drupal/imageapi_optimize_avif_webp:^1.1'
or
composer require 'drupal/imageapi_optimize_avif_webp:1.0.9'
install the module in drupal backend.
steps after installation:
step 1: on "/admin/config/media/imageapi-optimize-pipelines" added new pipeline
step 2: add processor "AVIF & WebP Deriver"
step 3: set quality for both to 50%
step 4: save the pipeline
step 5: on "/admin/config/media/image-styles" edit a style and add that new pipeline to it
step 6: save the image-style
Error occures
Comments
Comment #2
pyretta commentedComment #3
pyretta commentedComment #4
keshavv commentedPlease try https://stackoverflow.com/questions/70965543/how-to-enable-imageavif-in-...
Comment #5
hoangd commentedModule Requirements:
1. If using ImageMagick tookit then latest version of ImageMagick extension with 'Images format' AVIF must be enabled.
2. If using GD toolkit then PHP 8.1+ and php-gd extension must be enabled.
Comment #6
kevinquillen commentedRelated #3427310: Error: Call to undefined function AvifWebp->applyToImage() (line 85
The requirements above aren't enough - you have to have ImageMagik at a version that supports AVIF. For GD it has to be built with AVIF support. Just having it installed is not enough.
https://php.watch/versions/8.1/gd-avif
https://stackoverflow.com/questions/71739530/php-8-1-imageavif-avif-imag...
Comment #7
gurkawal commentedComment #8
gurkawal commentedComment #9
hoangd commentedCheck your PHP version. https://www.php.net/manual/en/function.imageavif.php
Comment #10
hoangd commented