[php-src] PR #15006: Cater to optional support of GD/GD2 image formats
| From: | cmb69 | Date: | Thu, 18 Jul 2024 11:55:28 +0000 |
| Subject: | [php-src] PR #15006: Cater to optional support of GD/GD2 image formats | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-27339@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/15006
Author: cmb69
Prior to libgd 2.3.0, support for the proprietary GD and GD2 image formats has was mandatory.
However, as of that version libgd can be built without support for these formats[1], and as of libgd
2.3.3 by default these formats are not supported[2].
If libgd is built without support for a certain image format, the respective reader and writer
functions are still defined, but they are NOPs. However, PHP GD users expect the reader and writer
function to only be defined, if there is actual support, so we're checking for the support
during build time, and declare the
HAVE_GD_GD macro only if support for the GD and GD2
image formats is available.
We do not change the bundled libgd to make support for these formats optional, yet.
[1] <https://github.com/libgd/libgd/issues/428>
[2] <https://github.com/libgd/libgd/blob/master/CHANGELOG.md#233---2021-09-12>
---
Just the first step. Yet missing:
* [ ] report support via gd_info() and PHP info
* [ ] adapt tests to properly check for availability
and maybe more. I'll continue to work on this ASAP, but wouldn't be sad if someone else
would take over, or at least help with testing on Linux with system libgd.