Skip to content

Add the gd extension, installed but disabled by default - #363

Open
mnapoli wants to merge 2 commits into
4.xfrom
v4-gd
Open

mnapoli wants to merge 2 commits into
4.xfrom
v4-gd

Conversation

@mnapoli

@mnapoli mnapoli commented Nov 23, 2026

Copy link
Copy Markdown
Member

gd as a shared extension, like intl and soap: installed but not loaded, enabled with extension=gd in php/conf.d/*.ini. JPEG, PNG, WebP and FreeType support.

No AVIF: it pulls libaom, dav1d, gav1, libyuv, abseil and libjpeg8 (+14 MB uncompressed, ~4 MB compressed), all loaded as soon as an application enables gd.

Measured on Lambda (arm64, 1024 MB, 30 cold starts per variant, interleaved):

  • image: +1.3 MB compressed, +2.9 MB uncompressed
  • gd installed but disabled: no difference (hello FPM -5 ms [-26, 16], Laravel +1 ms)
  • gd enabled: no measurable cold start difference (hello FPM -13 ms [-40, 12], Laravel +34 ms [-127, 176]), +2 MB of memory

JPEG, PNG, WebP and FreeType support. AVIF is left out: its libraries
(libavif, libaom, libdav1d, libgav1, abseil) add 14 MB to the image and
would all be loaded when gd is enabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant