tony2001 Tue May 22 10:22:49 2007 UTC
Added files: (Branch: PHP_5_2)
/php-src/ext/gd/tests bug41442.phpt
Modified files:
/php-src NEWS
/php-src/ext/gd gd.c
Log:
MFH: fix #41442 (imagegd2() under output control)
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.726&r2=1.2027.2.547.2.727&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.726 php-src/NEWS:1.2027.2.547.2.727
--- php-src/NEWS:1.2027.2.547.2.726 Mon May 21 16:50:03 2007
+++ php-src/NEWS Tue May 22 10:22:47 2007
@@ -21,6 +21,7 @@
- Fixed segfault in strripos(). (Tony, Joxean Koret)
- Fixed bug #41455 (ext/dba/config.m4 pollutes global $LIBS and $LDFLAGS).
(mmarek at suse dot cz, Tony)
+- Fixed bug #41442 (imagegd2() under output control). (Tony)
- Fixed bug #41430 (Fatal error with negative values of maxlen parameter of
file_get_contents()). (Tony)
- fixed bug #41423 (PHP assumes wrongly that certain ciphers are enabled in
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/gd.c?r1=1.312.2.20.2.25&r2=1.312.2.20.2.26&diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.312.2.20.2.25 php-src/ext/gd/gd.c:1.312.2.20.2.26
--- php-src/ext/gd/gd.c:1.312.2.20.2.25 Mon May 7 14:54:36 2007
+++ php-src/ext/gd/gd.c Tue May 22 10:22:49 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.312.2.20.2.25 2007/05/07 14:54:36 pajoye Exp $ */
+/* $Id: gd.c,v 1.312.2.20.2.26 2007/05/22 10:22:49 tony2001 Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -2826,6 +2826,14 @@
(*func_p)(im, fp);
break;
#endif
+#ifdef HAVE_GD_GD2
+ case PHP_GDIMG_TYPE_GD2:
+ if (q == -1) {
+ q = 128;
+ }
+ (*func_p)(im, fp, q, t);
+ break;
+#endif
default:
if (q == -1) {
q = 128;
@@ -2878,6 +2886,14 @@
(*func_p)(im, tmp);
break;
#endif
+#ifdef HAVE_GD_GD2
+ case PHP_GDIMG_TYPE_GD2:
+ if (q == -1) {
+ q = 128;
+ }
+ (*func_p)(im, tmp, q, t);
+ break;
+#endif
default:
(*func_p)(im, tmp);
break;
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/tests/bug41442.phpt?view=markup&rev=1.1
Index: php-src/ext/gd/tests/bug41442.phpt
+++ php-src/ext/gd/tests/bug41442.phpt
--TEST--
Bug #41442 (imagegd2() under output control)
--SKIPIF--
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available.");
}
if (!function_exists("imagegd2")) {
die("skip GD2 support unavailable");
}
?>
--FILE--
<?php
$str = file_get_contents(dirname(__FILE__).'/src.gd2');
$res = imagecreatefromstring($str);
/* string */
ob_start();
imagegd2($res);
$str2 = ob_get_clean();
var_dump(imagecreatefromstring($str2));
/* file */
$file = dirname(__FILE__)."/bug41442.gd2";
imagegd2($res, $file);
$str2 = file_get_contents($file);
var_dump(imagecreatefromstring($str2));
@unlink($file);
echo "Done\n";
?>
--EXPECTF--
resource(%d) of type (gd)
resource(%d) of type (gd)
Done
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php