Skip to content

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

Merged
mnapoli merged 2 commits into
4.xfrom
v4-gd
Nov 25, 2026
Merged

mnapoli merged 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.
@mnapoli
mnapoli merged commit 2cbfe52 into 4.x Nov 25, 2026
9 checks passed
@mnapoli
mnapoli deleted the v4-gd branch November 25, 2026 22:56
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