-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GD 2.1.0 support for PHP 5.5 #334
Conversation
Thanks for this great work ! Using a single HAVE_LIBGD21 seems a better idea than a specific flag for each function. Some comments
If we use, (defined(HAVE_GD_BUNDLED) || defined(HAVE_LIBGD21)) we don't need to define HAVE_LIBGD21 with builtin library (which explain the above issue) Having HAVE_LIBGD21 with bundled will allow to make conditional stuff simpler, but we need a placeholder for gdSetErrorMethod We can probably also use HAVE_LIBGD21 instead of HAVE_GD_IMAGE_FLIP (need to check if it is really new in 2.1)
We have tons of failed tests with the external library need to compare with the bundled. |
Note, with bundled library I only have 2 failed tests
|
I would love to see GD 2.1 in PHP, but I think we cannot aim for 5.5.0. I haven't tested the patch itself, but I think we should aim for 5.6.0. |
@dsp of course I agree with 5.6 as a target for bundled libgd 2.1 (or 2.2) But this patch (and some already committed changes) should (must) not change anything in 5.5 when using bundled libgd. Goal is, I think, just to allow (and improve) the possible use of system libgd when 2.1 is available. |
Yup, no change in PHP bundled libgd, but at the same time allow building with libgd 2.1.0. For 5.6.0 I think we can rip-out bundled libgd/ completely, since we have Pierre acting as upstream for libgd, so we can sync the needed changes very quickly. Or at least keep the changes in bundle libgd to minimal patch. |
@dsp we already have 2.1 in 5.5, this is only about supporting system 2.1 in 5.5+. These changes are only about config and #ifdef, no new code in ext/gd |
@remicollet @oerdnj you both have access to ext/gd, go ahead to make system's gd works out of the box with 5.5. That's something you have been waiting for too long already :) |
* Add missing return in _php_ctx_getmbi * Reintroduce imagecreatefromxbm by checking for gdCreateImageFromXbm
@remicollet Hi Remi, could you review this last bunch of updates? This is no longer very cosmetic, but major surgery. GD 2.0.x support is broken in PHP 5.5.0 anyway, so I see no harm in supporting only external GD 2.1.0. Otherwise I can build with --with-gd=yes (BUNDLED) and --with-gd=/usr (SYSTEM). However you are correct that the number of failed tests is much higher: But that's probably something which needs to be fixed in GD library itself. |
Sorry, I have miss the commit added a few days ago (no notification received) |
The github is wrong, I have pushed it to github today. |
build doesn't include anything from libgd/.
@remicollet I have also killed whole libgd/gd_compat.* And I hope we never divert so much (and fail so hard) ever again :(. |
Hmm... /dev/shm/BUILD/php5.5-201305041230/ext/gd/gd.c: In function 'gdPngGetVersionString': |
for PNG_LIBPNG_VER_STRING and JPEG_LIB_VERSION, just need to move the include "after" php ones (to have php_config.h) |
Also need to add, for XpmLibraryVersion
|
Commited. |
@oerdnj can you please close this PR ? |
ext/gd/tests/imageloadfont_invalid.phpt starts fails
not sure whether due to this change. didn't look into it deepy |
This adds almost all support for GD ext features (minus antialias functionality) using GD-2.1.0 library.
The extension compiles just fine with this patch, but it might need a review for GD-2.0 and GD-BUNDLED. Didn't have a time yet to try all variants.