- 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
}
(*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) {
}
(*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);
--- /dev/null
+--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