Skip to content

Commit 81f6d36

Browse files
morssssscmb69
authored andcommitted
Add avif support to ext/gd
This backports avif support from upstream libgd into bundled libgd and exposes the functionality through new imagecreatefromavif() and imageavif() functions. Closes GH-7026. Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
1 parent be92a87 commit 81f6d36

16 files changed

+830
-10
lines changed

.cirrus.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ task:
1111
#- sed -i -e 's/quarterly/latest/g' /etc/pkg/FreeBSD.conf
1212
#- pkg upgrade -y
1313
- kldload accf_http
14-
- pkg install -y autoconf bison gmake re2c icu libiconv png freetype2 enchant2 bzip2 krb5 t1lib gmp tidyp libsodium libzip libxml2 libxslt openssl oniguruma pkgconf webp
14+
- pkg install -y autoconf bison gmake re2c icu libiconv png freetype2 enchant2 bzip2 krb5 t1lib gmp tidyp libsodium libzip libxml2 libxslt openssl oniguruma pkgconf webp libavif
1515
script:
1616
- ./buildconf -f
17-
- ./configure --prefix=/usr/local --enable-debug --enable-option-checking=fatal --enable-fpm --with-pdo-sqlite --without-pear --with-bz2 --with-jpeg --with-webp --with-freetype --enable-gd --enable-exif --with-zip --with-zlib --enable-soap --enable-xmlreader --with-xsl --with-libxml --enable-shmop --enable-pcntl --enable-mbstring --with-curl --enable-sockets --with-openssl --with-iconv=/usr/local --enable-bcmath --enable-calendar --enable-ftp --with-kerberos --with-ffi --enable-zend-test --enable-intl --with-mhash --with-sodium --enable-werror --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d
17+
- ./configure --prefix=/usr/local --enable-debug --enable-option-checking=fatal --enable-fpm --with-pdo-sqlite --without-pear --with-bz2 --with-avif --with-jpeg --with-webp --with-freetype --enable-gd --enable-exif --with-zip --with-zlib --enable-soap --enable-xmlreader --with-xsl --with-libxml --enable-shmop --enable-pcntl --enable-mbstring --with-curl --enable-sockets --with-openssl --with-iconv=/usr/local --enable-bcmath --enable-calendar --enable-ftp --with-kerberos --with-ffi --enable-zend-test --enable-intl --with-mhash --with-sodium --enable-werror --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d
1818
- gmake -j2
1919
- mkdir /etc/php.d
2020
- gmake install

UPGRADING

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ PHP 8.1 UPGRADE NOTES
201201
when dynamic pm is selected. The default value is 32 which was the previous
202202
hard coded value.
203203

204+
- GD:
205+
. Avif support is now available through the imagecreatefromavif() and
206+
imageavif() functions, if libgd has been built with avif support.
207+
204208
- hash:
205209
. The following functions have changed signatures:
206210

Zend/Optimizer/zend_func_info.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,9 @@ static const func_info_t func_infos[] = {
760760
#ifdef HAVE_GD_JPG
761761
F1("imagecreatefromjpeg", MAY_BE_FALSE | MAY_BE_OBJECT),
762762
#endif
763+
#ifdef HAVE_GD_AVIF
764+
F1("imagecreatefromavif", MAY_BE_FALSE | MAY_BE_OBJECT),
765+
#endif
763766
#ifdef HAVE_GD_PNG
764767
F1("imagecreatefrompng", MAY_BE_FALSE | MAY_BE_OBJECT),
765768
#endif

appveyor/build_task.bat

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ if not exist "%DEPS_DIR%" (
4545
)
4646
if %errorlevel% neq 0 exit /b 3
4747

48+
rem install libavif into dependency directory
49+
rem temporary workaround for libavif not being part of the official dependencies
50+
if not exist "%DEPS_DIR%\libavif-0.9.0-%PHP_SDK_VS%-%PHP_SDK_ARCH%.zip" (
51+
curl -fsSL -o %DEPS_DIR%\libavif-0.9.0-%PHP_SDK_VS%-%PHP_SDK_ARCH%.zip https://windows.php.net/downloads/pecl/deps/libavif-0.9.0-%PHP_SDK_VS%-%PHP_SDK_ARCH%.zip
52+
)
53+
if not exist "%DEPS_DIR%\lib\avif.lib" (
54+
7z x %DEPS_DIR%\libavif-0.9.0-%PHP_SDK_VS%-%PHP_SDK_ARCH%.zip -o%DEPS_DIR%
55+
)
56+
4857
cmd /c buildconf.bat --force
4958
if %errorlevel% neq 0 exit /b 3
5059

ext/gd/config.m4

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ PHP_ARG_WITH([external-gd],
1313
[no],
1414
[no])
1515

16+
if test -z "$PHP_AVIF"; then
17+
PHP_ARG_WITH([avif],
18+
[for libavif],
19+
[AS_HELP_STRING([--with-avif],
20+
[GD: Enable AVIF support (only for bundled libgd)])],
21+
[no],
22+
[no])
23+
fi
24+
1625
if test -z "$PHP_WEBP"; then
1726
PHP_ARG_WITH([webp],
1827
[for libwebp],
@@ -71,6 +80,16 @@ AC_DEFUN([PHP_GD_PNG],[
7180
AC_DEFINE(HAVE_LIBPNG, 1, [ ])
7281
])
7382

83+
AC_DEFUN([PHP_GD_AVIF],[
84+
if test "$PHP_AVIF" != "no"; then
85+
PKG_CHECK_MODULES([AVIF], [libavif])
86+
PHP_EVAL_LIBLINE($AVIF_LIBS, GD_SHARED_LIBADD)
87+
PHP_EVAL_INCLINE($AVIF_CFLAGS)
88+
AC_DEFINE(HAVE_LIBAVIF, 1, [ ])
89+
AC_DEFINE(HAVE_GD_AVIF, 1, [ ])
90+
fi
91+
])
92+
7493
AC_DEFUN([PHP_GD_WEBP],[
7594
if test "$PHP_WEBP" != "no"; then
7695
PKG_CHECK_MODULES([WEBP], [libwebp])
@@ -121,6 +140,7 @@ AC_DEFUN([PHP_GD_JISX0208],[
121140

122141
AC_DEFUN([PHP_GD_CHECK_VERSION],[
123142
PHP_CHECK_LIBRARY(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG, 1, [ ])], [], [ $GD_SHARED_LIBADD ])
143+
PHP_CHECK_LIBRARY(gd, gdImageCreateFromAvif, [AC_DEFINE(HAVE_GD_AVIF, 1, [ ])], [], [ $GD_SHARED_LIBADD ])
124144
PHP_CHECK_LIBRARY(gd, gdImageCreateFromWebp, [AC_DEFINE(HAVE_GD_WEBP, 1, [ ])], [], [ $GD_SHARED_LIBADD ])
125145
PHP_CHECK_LIBRARY(gd, gdImageCreateFromJpeg, [AC_DEFINE(HAVE_GD_JPG, 1, [ ])], [], [ $GD_SHARED_LIBADD ])
126146
PHP_CHECK_LIBRARY(gd, gdImageCreateFromXpm, [AC_DEFINE(HAVE_GD_XPM, 1, [ ])], [], [ $GD_SHARED_LIBADD ])
@@ -141,7 +161,7 @@ if test "$PHP_GD" != "no"; then
141161
dnl Disable strict prototypes as GD takes advantages of variadic function signatures for function pointers.
142162
GD_CFLAGS="-Wno-strict-prototypes"
143163
extra_sources="libgd/gd.c libgd/gd_gd.c libgd/gd_gd2.c libgd/gd_io.c libgd/gd_io_dp.c \
144-
libgd/gd_io_file.c libgd/gd_ss.c libgd/gd_io_ss.c libgd/gd_webp.c \
164+
libgd/gd_io_file.c libgd/gd_ss.c libgd/gd_io_ss.c libgd/gd_webp.c libgd/gd_avif.c \
145165
libgd/gd_png.c libgd/gd_jpeg.c libgd/gdxpm.c libgd/gdfontt.c libgd/gdfonts.c \
146166
libgd/gdfontmb.c libgd/gdfontl.c libgd/gdfontg.c libgd/gdtables.c libgd/gdft.c \
147167
libgd/gdcache.c libgd/gdkanji.c libgd/wbmp.c libgd/gd_wbmp.c libgd/gdhelpers.c \
@@ -162,6 +182,7 @@ dnl These are always available with bundled library
162182
dnl Various checks for GD features
163183
PHP_GD_ZLIB
164184
PHP_GD_PNG
185+
PHP_GD_AVIF
165186
PHP_GD_WEBP
166187
PHP_GD_JPEG
167188
PHP_GD_XPM

ext/gd/config.w32

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
ARG_WITH("gd", "Bundled GD support", "yes,shared");
44
ARG_WITH("libwebp", "webp support", "yes");
5+
ARG_WITH("libavif", "avif support", "yes");
56

67
if (PHP_GD != "no") {
78
if (
@@ -30,6 +31,14 @@ if (PHP_GD != "no") {
3031
WARNING("libwebp not enabled; libraries and headers not found");
3132
}
3233
}
34+
if (PHP_LIBAVIF != "no") {
35+
if (CHECK_LIB("avif.lib", "gd", PHP_GD) &&
36+
CHECK_HEADER_ADD_INCLUDE("avif.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\avif")) {
37+
ADD_FLAG("CFLAGS_GD", "/D HAVE_LIBAVIF /D HAVE_GD_AVIF");
38+
} else {
39+
WARNING("libavif not enabled; libraries and headers not found");
40+
}
41+
}
3342
CHECK_LIB("User32.lib", "gd", PHP_GD);
3443
CHECK_LIB("Gdi32.lib", "gd", PHP_GD);
3544

@@ -39,7 +48,7 @@ if (PHP_GD != "no") {
3948
gdft.c gd_gd2.c gd_gd.c gd_gif_in.c gd_gif_out.c gdhelpers.c gd_io.c gd_io_dp.c \
4049
gd_io_file.c gd_io_ss.c gd_jpeg.c gdkanji.c gd_png.c gd_ss.c \
4150
gdtables.c gd_topal.c gd_wbmp.c gdxpm.c wbmp.c gd_xbm.c gd_security.c gd_transform.c \
42-
gd_filter.c gd_pixelate.c gd_rotate.c gd_color_match.c gd_webp.c \
51+
gd_filter.c gd_pixelate.c gd_rotate.c gd_color_match.c gd_webp.c gd_avif.c \
4352
gd_crop.c gd_interpolation.c gd_matrix.c gd_bmp.c gd_tga.c", "gd");
4453
AC_DEFINE('HAVE_LIBGD', 1, 'GD support');
4554
ADD_FLAG("CFLAGS_GD", " \

ext/gd/gd.c

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
# include <X11/xpm.h>
5555
#endif
5656

57-
5857
#include "gd_compat.h"
5958

6059
#ifdef HAVE_GD_BUNDLED
@@ -371,6 +370,7 @@ PHP_MINIT_FUNCTION(gd)
371370

372371
REGISTER_INI_ENTRIES();
373372

373+
REGISTER_LONG_CONSTANT("IMG_AVIF", PHP_IMG_AVIF, CONST_CS | CONST_PERSISTENT);
374374
REGISTER_LONG_CONSTANT("IMG_GIF", PHP_IMG_GIF, CONST_CS | CONST_PERSISTENT);
375375
REGISTER_LONG_CONSTANT("IMG_JPG", PHP_IMG_JPG, CONST_CS | CONST_PERSISTENT);
376376
REGISTER_LONG_CONSTANT("IMG_JPEG", PHP_IMG_JPEG, CONST_CS | CONST_PERSISTENT);
@@ -601,6 +601,9 @@ PHP_MINFO_FUNCTION(gd)
601601
#ifdef HAVE_GD_BMP
602602
php_info_print_table_row(2, "BMP Support", "enabled");
603603
#endif
604+
#ifdef HAVE_GD_AVIF
605+
php_info_print_table_row(2, "AVIF Support", "enabled");
606+
#endif
604607
#ifdef HAVE_GD_TGA
605608
php_info_print_table_row(2, "TGA Read Support", "enabled");
606609
#endif
@@ -655,6 +658,11 @@ PHP_FUNCTION(gd_info)
655658
#else
656659
add_assoc_bool(return_value, "BMP Support", 0);
657660
#endif
661+
#ifdef HAVE_GD_AVIF
662+
add_assoc_bool(return_value, "AVIF Support", 1);
663+
#else
664+
add_assoc_bool(return_value, "AVIF Support", 0);
665+
#endif
658666
#ifdef HAVE_GD_TGA
659667
add_assoc_bool(return_value, "TGA Read Support", 1);
660668
#else
@@ -1407,7 +1415,7 @@ PHP_FUNCTION(imagecreate)
14071415
}
14081416
/* }}} */
14091417

1410-
/* {{{ Return the types of images supported in a bitfield - 1=GIF, 2=JPEG, 4=PNG, 8=WBMP, 16=XPM */
1418+
/* {{{ Return the types of images supported in a bitfield - 1=GIF, 2=JPEG, 4=PNG, 8=WBMP, 16=XPM, etc */
14111419
PHP_FUNCTION(imagetypes)
14121420
{
14131421
int ret = 0;
@@ -1431,6 +1439,9 @@ PHP_FUNCTION(imagetypes)
14311439
#ifdef HAVE_GD_TGA
14321440
ret |= PHP_IMG_TGA;
14331441
#endif
1442+
#ifdef HAVE_GD_AVIF
1443+
ret |= PHP_IMG_AVIF;
1444+
#endif
14341445

14351446
if (zend_parse_parameters_none() == FAILURE) {
14361447
RETURN_THROWS();
@@ -1589,6 +1600,15 @@ PHP_FUNCTION(imagecreatefromstring)
15891600
RETURN_FALSE;
15901601
#endif
15911602

1603+
case PHP_GDIMG_TYPE_AVIF:
1604+
#ifdef HAVE_GD_AVIF
1605+
im = _php_image_create_from_string(data, "AVIF", gdImageCreateFromAvifCtx);
1606+
break;
1607+
#else
1608+
php_error_docref(NULL, E_WARNING, "No AVIF support in this PHP build");
1609+
RETURN_FALSE;
1610+
#endif
1611+
15921612
default:
15931613
php_error_docref(NULL, E_WARNING, "Data is not in a recognized format");
15941614
RETURN_FALSE;
@@ -1769,6 +1789,15 @@ PHP_FUNCTION(imagecreatefromxbm)
17691789
}
17701790
/* }}} */
17711791

1792+
#ifdef HAVE_GD_AVIF
1793+
/* {{{ Create a new image from AVIF file or URL */
1794+
PHP_FUNCTION(imagecreatefromavif)
1795+
{
1796+
_php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_AVIF, "AVIF", gdImageCreateFromAvif, gdImageCreateFromAvifCtx);
1797+
}
1798+
/* }}} */
1799+
#endif /* HAVE_GD_AVIF */
1800+
17721801
#ifdef HAVE_GD_XPM
17731802
/* {{{ Create a new image from XPM file or URL */
17741803
PHP_FUNCTION(imagecreatefromxpm)
@@ -1996,6 +2025,15 @@ PHP_FUNCTION(imagewebp)
19962025
/* }}} */
19972026
#endif /* HAVE_GD_WEBP */
19982027

2028+
#ifdef HAVE_GD_AVIF
2029+
/* {{{ Output AVIF image to browser or file */
2030+
PHP_FUNCTION(imageavif)
2031+
{
2032+
_php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_AVIF, "AVIF", gdImageAvifCtx);
2033+
}
2034+
/* }}} */
2035+
#endif /* HAVE_GD_AVIF */
2036+
19992037
#ifdef HAVE_GD_JPG
20002038
/* {{{ Output JPEG image to browser or file */
20012039
PHP_FUNCTION(imagejpeg)
@@ -4178,7 +4216,7 @@ static gdIOCtx *create_output_context() {
41784216
static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)())
41794217
{
41804218
zval *imgind;
4181-
zend_long quality = -1, basefilter = -1;
4219+
zend_long quality = -1, basefilter = -1, speed = -1;
41824220
gdImagePtr im;
41834221
gdIOCtx *ctx = NULL;
41844222
zval *to_zval = NULL;
@@ -4191,6 +4229,10 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
41914229
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|z!ll", &imgind, gd_image_ce, &to_zval, &quality, &basefilter) == FAILURE) {
41924230
RETURN_THROWS();
41934231
}
4232+
} else if (image_type == PHP_GDIMG_TYPE_AVIF) {
4233+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|z!ll", &imgind, gd_image_ce, &to_zval, &quality, &speed) == FAILURE) {
4234+
RETURN_THROWS();
4235+
}
41944236
} else {
41954237
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|z!l", &imgind, gd_image_ce, &to_zval, &quality) == FAILURE) {
41964238
RETURN_THROWS();
@@ -4218,6 +4260,12 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
42184260
}
42194261
(*func_p)(im, ctx, (int) quality);
42204262
break;
4263+
case PHP_GDIMG_TYPE_AVIF:
4264+
if (speed == -1) {
4265+
speed = 6;
4266+
}
4267+
(*func_p)(im, ctx, (int) quality, (int) speed);
4268+
break;
42214269
case PHP_GDIMG_TYPE_PNG:
42224270
(*func_p)(im, ctx, (int) quality, (int) basefilter);
42234271
break;

ext/gd/gd.stub.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ function imagetypes(): int {}
6666

6767
function imagecreatefromstring(string $data): GdImage|false {}
6868

69+
#ifdef HAVE_GD_AVIF
70+
function imagecreatefromavif(string $filename): GdImage|false {}
71+
#endif
72+
6973
function imagecreatefromgif(string $filename): GdImage|false {}
7074

7175
#ifdef HAVE_GD_JPG
@@ -104,6 +108,11 @@ function imagecreatefromtga(string $filename): GdImage|false {}
104108

105109
function imagexbm(GdImage $image, ?string $filename, ?int $foreground_color = null): bool {}
106110

111+
#ifdef HAVE_GD_AVIF
112+
/** @param resource|string|null $file */
113+
function imageavif(GdImage $image, $file = null, int $quality = -1, int $speed = -1): bool {}
114+
#endif
115+
107116
/** @param resource|string|null $file */
108117
function imagegif(GdImage $image, $file = null): bool {}
109118

ext/gd/gd_arginfo.h

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 4db5a04f57436fffff4d34f4e44db7b7fdc39874 */
2+
* Stub hash: 6c091ec5dc43771d26c3dac479ede7b38aa6e574 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gd_info, 0, 0, IS_ARRAY, 0)
55
ZEND_END_ARG_INFO()
@@ -144,6 +144,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imagecreatefromstring, 0, 1,
144144
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
145145
ZEND_END_ARG_INFO()
146146

147+
#if defined(HAVE_GD_AVIF)
148+
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imagecreatefromavif, 0, 1, GdImage, MAY_BE_FALSE)
149+
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
150+
ZEND_END_ARG_INFO()
151+
#endif
152+
147153
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imagecreatefromgif, 0, 1, GdImage, MAY_BE_FALSE)
148154
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
149155
ZEND_END_ARG_INFO()
@@ -206,6 +212,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagexbm, 0, 2, _IS_BOOL, 0)
206212
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, foreground_color, IS_LONG, 1, "null")
207213
ZEND_END_ARG_INFO()
208214

215+
#if defined(HAVE_GD_AVIF)
216+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageavif, 0, 1, _IS_BOOL, 0)
217+
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
218+
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, file, "null")
219+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, quality, IS_LONG, 0, "-1")
220+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, speed, IS_LONG, 0, "-1")
221+
ZEND_END_ARG_INFO()
222+
#endif
223+
209224
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagegif, 0, 1, _IS_BOOL, 0)
210225
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
211226
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, file, "null")
@@ -593,6 +608,9 @@ ZEND_FUNCTION(imagesetbrush);
593608
ZEND_FUNCTION(imagecreate);
594609
ZEND_FUNCTION(imagetypes);
595610
ZEND_FUNCTION(imagecreatefromstring);
611+
#if defined(HAVE_GD_AVIF)
612+
ZEND_FUNCTION(imagecreatefromavif);
613+
#endif
596614
ZEND_FUNCTION(imagecreatefromgif);
597615
#if defined(HAVE_GD_JPG)
598616
ZEND_FUNCTION(imagecreatefromjpeg);
@@ -618,6 +636,9 @@ ZEND_FUNCTION(imagecreatefrombmp);
618636
ZEND_FUNCTION(imagecreatefromtga);
619637
#endif
620638
ZEND_FUNCTION(imagexbm);
639+
#if defined(HAVE_GD_AVIF)
640+
ZEND_FUNCTION(imageavif);
641+
#endif
621642
ZEND_FUNCTION(imagegif);
622643
#if defined(HAVE_GD_PNG)
623644
ZEND_FUNCTION(imagepng);
@@ -728,6 +749,9 @@ static const zend_function_entry ext_functions[] = {
728749
ZEND_FE(imagecreate, arginfo_imagecreate)
729750
ZEND_FE(imagetypes, arginfo_imagetypes)
730751
ZEND_FE(imagecreatefromstring, arginfo_imagecreatefromstring)
752+
#if defined(HAVE_GD_AVIF)
753+
ZEND_FE(imagecreatefromavif, arginfo_imagecreatefromavif)
754+
#endif
731755
ZEND_FE(imagecreatefromgif, arginfo_imagecreatefromgif)
732756
#if defined(HAVE_GD_JPG)
733757
ZEND_FE(imagecreatefromjpeg, arginfo_imagecreatefromjpeg)
@@ -753,6 +777,9 @@ static const zend_function_entry ext_functions[] = {
753777
ZEND_FE(imagecreatefromtga, arginfo_imagecreatefromtga)
754778
#endif
755779
ZEND_FE(imagexbm, arginfo_imagexbm)
780+
#if defined(HAVE_GD_AVIF)
781+
ZEND_FE(imageavif, arginfo_imageavif)
782+
#endif
756783
ZEND_FE(imagegif, arginfo_imagegif)
757784
#if defined(HAVE_GD_PNG)
758785
ZEND_FE(imagepng, arginfo_imagepng)

0 commit comments

Comments
 (0)