]> granicus.if.org Git - php/commitdiff
- #40764, line thickness not respected for horizontal and vertical lines
authorPierre Joye <pajoye@php.net>
Sat, 10 Mar 2007 01:13:19 +0000 (01:13 +0000)
committerPierre Joye <pajoye@php.net>
Sat, 10 Mar 2007 01:13:19 +0000 (01:13 +0000)
 - add test
 - NEWS entry

NEWS
ext/gd/tests/bug40764.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index be0774ce9234364bbc623f69085154e8d1b8035d..69b334a01e4b0db0f66571dd2cf2aaeec25d6fa4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,8 @@ PHP                                                                        NEWS
 - Added tidyNode::getParent() method (John, Nuno)
 - Fixed zend_llist_remove_tail (Michael Wallner, Dmitry)
 - Fixed a thread safety issue in gd gif read code (Nuno, Roman Nemecek)
+- Fixed bug #40764, line thickness not respected for horizontal and vertical 
+  lines (Pierre)
 - Fixed bug #40754 (added substr() & substr_replace() overflow checks). (Ilia)
 - Fixed bug #40752 (parse_ini_file() segfaults when a scalar setting is 
   redeclared as an array). (Tony)
diff --git a/ext/gd/tests/bug40764.phpt b/ext/gd/tests/bug40764.phpt
new file mode 100644 (file)
index 0000000..cbe262f
--- /dev/null
@@ -0,0 +1,31 @@
+--TEST--
+Bug #40764 (line thickness not respected for horizontal and vertical lines)
+--SKIPIF--
+<?php 
+       if (!extension_loaded('gd')) die("skip gd extension not available\n"); 
+?>
+--FILE--
+<?php
+$image=imagecreatetruecolor(400, 400);
+$white = imagecolorallocate($image, 255, 255, 255);
+$black = imagecolorallocate($image, 0, 0, 0);
+$red = imagecolorallocate($image, 255, 0, 0);
+
+imagefill($image, 0, 0, $white);
+imagesetthickness($image, 10);
+
+imageline($image, 200, 0, 200, 400, $black);
+imageline($image, 0, 200, 400, 200, $black);
+imageline($image, 0, 0, 392, 392, $black);
+
+imagesetthickness($image, 1);
+
+imageline($image, 200, 0, 200, 400, $red);
+imageline($image, 0, 200, 400, 200, $red);
+imageline($image, 0, 0, 392, 392, $red);
+print_r(imagecolorat($image, 195, 0));
+print_r(imagecolorat($image, 0, 195));
+
+?>
+--EXPECT--
+00