Skip to content

Conversation

@adamziel
Copy link
Collaborator

@adamziel adamziel commented Nov 26, 2025

Motivation for the change, related issues

Upgrades GD version to 2.3.3. The EWWW Image Optimizer relies on GD library features shipped with a more recent GD version than the one bundled with PHP. See nosilver4u/ewww-image-optimizer#377

Implementation details

PHP comes with a bundled GD version 2.1.0. Upgrading to 2.3.3 involves:

  • Downloading and building 2.3.3 as a separate library (living in packages/php-wasm/compile/libgd)
  • Using it while compiling PHP 8.1+ via --with-external-gd
  • Falling back to the bundled libgd==2.1.0 for PHP <= 8.0. These older PHP releases don't seem to be compatible with newer GD and fail to build due to multiple missing symbols, e.g. /root/php-src/ext/gd/gd.c:3536:8: error: use of undeclared identifier 'GD_FLIP_VERTICAL'.

Testing Instructions (or ideally a Blueprint)

CI – we have tests covering gd across all PHP versions.

@adamziel adamziel marked this pull request as ready for review November 27, 2025 23:05
@adamziel adamziel requested a review from a team as a code owner November 27, 2025 23:05
@adamziel
Copy link
Collaborator Author

There's some superficial differences in whitespaces, I'll adjust them in a follow-up.

@adamziel adamziel merged commit dc68872 into trunk Nov 27, 2025
28 checks passed
@adamziel adamziel deleted the gd-2-3-3 branch November 27, 2025 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants