Skip to content

Enable bundled GD with JPEG and FreeType configure options - #782

Draft
andr2k wants to merge 1 commit into
php:1.6.xfrom
andr2k:gd-jpeg-freetype
Draft

andr2k wants to merge 1 commit into
php:1.6.xfrom
andr2k:gd-jpeg-freetype

Conversation

@andr2k

@andr2k andr2k commented Oct 21, 2026

Copy link
Copy Markdown

pie install php/gd currently fails during package resolution because GD is excluded from the bundled-extension repository. This registers php/gd and exposes optional --with-jpeg and --with-freetype flags, so users can build GD with the image capabilities they need.

pie install php/gd --force --with-jpeg --with-freetype

The existing build-provider refusal and --force override remain unchanged. JPEG and FreeType remain opt-in; their development libraries must be installed. The package requires PHP 7.4+ because that is when these configure flag names were introduced.

The change adds package/option unit coverage and a CI build test across the existing PHP 8.1–8.5 bundled-extension matrix. The build test installs the default package and then rebuilds the same version with both flags, checking PNG/JPEG encode/decode and actual FreeType text rendering in fresh PHP processes.

Validation

  • Full PHPUnit suite on PHP 8.5.12: 746 tests, 1,602 assertions, no failures; 26 environment-dependent skips and one existing incomplete test.
  • Full PHPStan and PHP_CodeSniffer checks pass, including separate style checks for the two new test scripts.
  • Actual PIE installs and functional checks pass in Linux arm64 official PHP containers on 8.1.34, 8.2.35, 8.3.36, 8.4.27, and 8.5.12, with both default and JPEG/FreeType configurations.
  • The same default/configured checks also pass with Debian bookworm’s packaged PHP 8.2.35.
  • Confirmed that installation without --force still refuses the bundled extension in the official PHP Docker image.

The historical ft2build.h failure recorded in the original GD review thread was not reproduced in these environments. This PR does not claim to establish its original cause; the added build/feature tests are intended to make the proposed support verifiable.

Discussion status

Discussion #781 was opened before implementation. Maintainer feedback is still pending; this PR is a draft for review, and the discussion checklist item below remains unchecked.

PR submitter checklist

  • I have read CONTRIBUTING.md
  • I discussed this feature with the maintainers in #781 (feedback pending)
  • I have added appropriate tests
  • I confirm that I have the right to submit this under the project's open source licence

This branch has not been deployed

No deployments
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