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

pyretta created an issue. See original summary.

pyretta’s picture

Issue summary: View changes
pyretta’s picture

Issue summary: View changes
keshavv’s picture

hoangd’s picture

Module 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.

kevinquillen’s picture

Related #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...

gurkawal’s picture

Assigned: Unassigned » gurkawal
gurkawal’s picture

Assigned: gurkawal » Unassigned
hoangd’s picture

Status: Active » Fixed
hoangd’s picture

Status: Fixed » Closed (fixed)