From 93b3bc490d9db13759ff6f3309f479539904b0f3 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Tue, 22 May 2007 09:44:55 +0000 Subject: [PATCH] fix #41442 (imagegd2() under output control) --- ext/gd/gd.c | 8 ++++++++ ext/gd/tests/bug41442.phpt | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 ext/gd/tests/bug41442.phpt diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 464951b714..0b1d29edec 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -2563,6 +2563,14 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char } (*func_p)(im, fp); break; +#ifdef HAVE_GD_GD2 + case PHP_GDIMG_TYPE_GD2: + if (quality == -1) { + quality = 128; + } + (*func_p)(im, fp, quality, type); + break; +#endif default: if (quality == -1) { quality = 128; diff --git a/ext/gd/tests/bug41442.phpt b/ext/gd/tests/bug41442.phpt new file mode 100644 index 0000000000..78a61bec95 --- /dev/null +++ b/ext/gd/tests/bug41442.phpt @@ -0,0 +1,37 @@ +--TEST-- +Bug #41442 (imagegd2() under output control) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +resource(%d) of type (gd) +resource(%d) of type (gd) +Done -- 2.50.1