]> granicus.if.org Git - php/commitdiff
Fix #72604: imagearc() ignores thickness for full arcs
authorChristoph M. Becker <cmb@php.net>
Fri, 15 Jul 2016 17:42:26 +0000 (19:42 +0200)
committerChristoph M. Becker <cmb@php.net>
Fri, 15 Jul 2016 17:45:52 +0000 (19:45 +0200)
We remove the special casing for full arcs, what conforms to external libgd.

NEWS
ext/gd/libgd/gd.c
ext/gd/tests/bug72604.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 455e44b8424bbc761a5d7b5476fb093ee0f31b7e..caf807311fc2538854590fca4efda8667fcb2f4a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,7 @@ PHP                                                                        NEWS
 
 - GD:
   . Fixed bug #72596 (imagetypes function won't advertise WEBP support). (cmb)
+  . Fixed bug #72604 (imagearc() ignores thickness for full arcs). (cmb)
 
 - Intl:
   . Partially fixed #72506 (idn_to_ascii for UTS #46 incorrect for long domain
index a5799c59d55afd81eda6903f91583447a92dc1db..3b5d8294e87647280ea931dbd7d9a1de76d2e5e3 100644 (file)
@@ -1673,11 +1673,7 @@ long lsqrt (long n)
 
 void gdImageArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color)
 {
-       if ((s % 360) == (e % 360)) {
-               gdImageEllipse(im, cx, cy, w, h, color);
-       } else {
-               gdImageFilledArc(im, cx, cy, w, h, s, e, color, gdNoFill);
-       }
+       gdImageFilledArc(im, cx, cy, w, h, s, e, color, gdNoFill);
 }
 
 void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int style)
diff --git a/ext/gd/tests/bug72604.phpt b/ext/gd/tests/bug72604.phpt
new file mode 100644 (file)
index 0000000..b1dea5e
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+Bug #72604 (imagearc() ignores thickness for full arcs)
+--SKIPIF--
+<?php
+if (!extension_loaded('gd')) die('skip requires ext/gd');
+if (!(imagetypes() & IMG_PNG)) die('skip requires PNG support');
+?>
+--FILE--
+<?php
+$im = imagecreatetruecolor(100, 100);
+imagesetthickness($im, 5);
+imagearc($im, 50, 50, 90, 90, 0, 360, 0xffffff);
+ob_start();
+imagepng($im);
+$imagestring = ob_get_clean();
+echo md5($imagestring);
+?>
+--EXPECT--
+2ffa6afb915afbdf870cf6459477bc8a