Bug #81217 [NEW]: imageavif() fails - Segmentation Fault or No codec available
| From: | mlocati at gmail dot com | Date: | Thu, 01 Jul 2021 15:04:54 +0000 |
| Subject: | Bug #81217 [NEW]: imageavif() fails - Segmentation Fault or No codec available | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-234743@lists.php.net to get a copy of this message | ||
From: mlocati at gmail dot com
Operating system: Debian Buster and Alpine Linux
PHP version: 8.1.0alpha2
Package: GD related
Bug Type: Bug
Bug description:imageavif() fails - Segmentation Fault or No codec available
Description:
------------
I tried the brand new imageavif() function, but I can't make it work.
# On Debian Buster
Launch a docker container with
docker run --rm -it php:8.1.0alpha2-cli-buster bash
Run these commands:
$ echo 'deb http://deb.debian.org/debian
buster-backports main'
>/etc/apt/sources.list.d/buster-backports.list
$ apt-get update
$ apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev
libxpm-dev libwebp-dev libavif-dev
$ docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg
--with-xpm --with-freetype --with-avif
$ docker-php-ext-install -j$(nproc) gd
$ php --ri gd
gd
GD Support => enabled
GD Version => bundled (2.1.0 compatible)
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.9.1
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 6b
PNG Support => enabled
libPNG Version => 1.6.36
WBMP Support => enabled
XPM Support => enabled
libXpm Version => 30411
XBM Support => enabled
WebP Support => enabled
BMP Support => enabled
AVIF Support => enabled
TGA Read Support => enabled
Directive => Local Value => Master Value
gd.jpeg_ignore_warning => 1 => 1
$ php -r 'var_dump(imageavif(imagecreatetruecolor(8, 8),
"/tmp/test"));'
Segmentation fault
# On Alpine Linux 3.14
Launch a docker container with
docker run --rm -it php:8.1.0alpha2-cli-alpine3.14 sh
Run these commands:
$ apk add freetype-dev libjpeg-turbo-dev libpng-dev libxpm-dev
libwebp-dev libavif-dev
$ docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg
--with-xpm --with-freetype --with-avif
$ docker-php-ext-install -j$(nproc) gd
$ php --ri gd
gd
GD Support => enabled
GD Version => bundled (2.1.0 compatible)
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.10.4
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 8
PNG Support => enabled
libPNG Version => 1.6.37
WBMP Support => enabled
XPM Support => enabled
libXpm Version => 30411
XBM Support => enabled
WebP Support => enabled
BMP Support => enabled
AVIF Support => enabled
TGA Read Support => enabled
Directive => Local Value => Master Value
gd.jpeg_ignore_warning => 1 => 1
$ php -r 'var_dump(imageavif(imagecreatetruecolor(8, 8),
"/tmp/test"));'
Warning: imageavif(): avif error - Could not encode image: No codec
available in Command line code on line 1
bool(true)
$ php -r 'var_dump(filesize("/tmp/test"));'
int(0)
--
Edit bug report at https://bugs.php.net/bug.php?id=81217&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81217&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81217&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81217&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81217&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81217&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81217&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81217&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81217&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81217&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81217&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81217&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81217&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81217&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81217&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81217&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81217&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81217&r=mysqlcfg