diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2018-03-30 19:22:23 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2018-03-30 19:22:23 +0200 |
commit | 9c37d95627f75dc300fd0af5df6c87d6ad92e363 (patch) | |
tree | b41347b5084d17cce3101445e720ef577de7a440 | |
parent | 2688023c7fdc1b1e319cb81c28a862f65a2109fb (diff) | |
download | php-git-9c37d95627f75dc300fd0af5df6c87d6ad92e363.tar.gz |
Fix #52070: imagedashedline() - dashed line sometimes is not visible
We finally remove the inadvertent leftover from the synchronization
with GD 2.0.12.
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | ext/gd/libgd/gd.c | 1 | ||||
-rw-r--r-- | ext/gd/tests/bug52070.phpt | 25 | ||||
-rw-r--r-- | ext/gd/tests/bug52070.png | bin | 0 -> 2223 bytes |
4 files changed, 29 insertions, 1 deletions
@@ -10,6 +10,10 @@ PHP NEWS too long). (Jacob Hipps) . Fixed incorrect write to getenv result in FPM reload. (Jakub Zelenka) +- GD: + . Fixed bug #52070 (imagedashedline() - dashed line sometimes is not visible). + (cmb) + - mbstring: . Fixed bug #75944 (Wrong cp1251 detection). (dmk001) . Fixed bug #76113 (mbstring does not build with Oniguruma 6.8.1). diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 8d1e48dce5..a6c3d393b2 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -1392,7 +1392,6 @@ void gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color } else { wid = 1; } - wid = (int)(thick * sin(atan2(dy, dx))); vert = 1; d = 2 * dy - dx; diff --git a/ext/gd/tests/bug52070.phpt b/ext/gd/tests/bug52070.phpt new file mode 100644 index 0000000000..acf56e6b5b --- /dev/null +++ b/ext/gd/tests/bug52070.phpt @@ -0,0 +1,25 @@ +--TEST--
+Bug #52070 (imagedashedline() - dashed line sometimes is not visible)
+--SKIPIF--
+<?php
+if (!extension_loaded('gd')) die('skip gd extension not available');
+?>
+--FILE--
+<?php
+$im = imagecreate(1200, 800);
+$background_color = imagecolorallocate($im, 40, 40, 40);
+$color = imagecolorallocate($im, 255, 255, 255);
+imagedashedline($im, 800, 400, 300, 400, $color);
+imagedashedline($im, 800, 400, 300, 800, $color);
+imagedashedline($im, 800, 400, 400, 800, $color);
+imagedashedline($im, 800, 400, 500, 800, $color);
+imagedashedline($im, 800, 400, 600, 800, $color);
+imagedashedline($im, 800, 400, 700, 800, $color);
+imagedashedline($im, 800, 400, 800, 800, $color);
+include_once __DIR__ . '/func.inc';
+test_image_equals_file(__DIR__ . '/bug52070.png', $im);
+?>
+===DONE===
+--EXPECT--
+The images are equal.
+===DONE===
diff --git a/ext/gd/tests/bug52070.png b/ext/gd/tests/bug52070.png Binary files differnew file mode 100644 index 0000000000..5ce54b121b --- /dev/null +++ b/ext/gd/tests/bug52070.png |