diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | ext/exif/tests/bug62523_2.phpt | 2 | ||||
-rw-r--r-- | ext/exif/tests/bug72603.phpt | 4 | ||||
-rw-r--r-- | ext/exif/tests/bug72618.phpt | 4 | ||||
-rw-r--r-- | ext/gd/libgd/gd.c | 41 | ||||
-rw-r--r-- | ext/gd/tests/bug43828.phpt | 23 | ||||
-rw-r--r-- | ext/gd/tests/imagecolorallocatealpha_basic.phpt | 2 |
7 files changed, 57 insertions, 21 deletions
@@ -30,6 +30,8 @@ PHP NEWS . Fixed bug #72596 (imagetypes function won't advertise WEBP support). (cmb) . Fixed bug #72604 (imagearc() ignores thickness for full arcs). (cmb) . Fixed bug #70315 (500 Server Error but page is fully rendered). (cmb) + . Fixed bug #43828 (broken transparency of imagearc for truecolor in + blendingmode). (cmb) - Intl: . Partially fixed #72506 (idn_to_ascii for UTS #46 incorrect for long domain diff --git a/ext/exif/tests/bug62523_2.phpt b/ext/exif/tests/bug62523_2.phpt index c533d42652..689ed0679d 100644 --- a/ext/exif/tests/bug62523_2.phpt +++ b/ext/exif/tests/bug62523_2.phpt @@ -13,6 +13,6 @@ Done --EXPECTF-- Test -Warning: exif_read_data(bug62523_2.jpg): IFD data bad offset: 0xADB23672 length 0x0D94 in %s/bug62523_2.php on line %d +Warning: exif_read_data(bug62523_2.jpg): IFD data bad offset: 0xADB23672 length 0x0D94 in %s%ebug62523_2.php on line %d int(30) Done diff --git a/ext/exif/tests/bug72603.phpt b/ext/exif/tests/bug72603.phpt index a4295f9848..71d3943446 100644 --- a/ext/exif/tests/bug72603.phpt +++ b/ext/exif/tests/bug72603.phpt @@ -7,5 +7,5 @@ Bug #72603 (Out of bound read in exif_process_IFD_in_MAKERNOTE) var_dump(count(exif_read_data(dirname(__FILE__) . "/bug72603.jpeg"))); ?> --EXPECTF-- -Warning: exif_read_data(bug72603.jpeg): IFD data bad offset: 0x058C length 0x001C in %s/bug72603.php on line %d -int(13)
\ No newline at end of file +Warning: exif_read_data(bug72603.jpeg): %s in %s%ebug72603.php on line %d +int(%d) diff --git a/ext/exif/tests/bug72618.phpt b/ext/exif/tests/bug72618.phpt index 424c0ec402..c4fe8e3f90 100644 --- a/ext/exif/tests/bug72618.phpt +++ b/ext/exif/tests/bug72618.phpt @@ -7,5 +7,5 @@ Bug 72618 (NULL Pointer Dereference in exif_process_user_comment) var_dump(count(exif_read_data(dirname(__FILE__) . "/bug72618.jpg"))); ?> --EXPECTF-- -Warning: exif_read_data(bug72618.jpg): IFD data bad offset: 0x058E length 0x0030 in %s/bug72618.php on line %d -int(13)
\ No newline at end of file +Warning: exif_read_data(bug72618.jpg): %s in %s%ebug72618.php on line %d +int(%d) diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index fc63cd379c..299c432afa 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -1670,9 +1670,7 @@ long lsqrt (long n) /* s and e are integers modulo 360 (degrees), with 0 degrees being the rightmost extreme and degrees changing clockwise. cx and cy are the center in pixels; w and h are the horizontal - and vertical diameter in pixels. Nice interface, but slow. - See gd_arc_f_buggy.c for a better version that doesn't - seem to be bug-free yet. */ + and vertical diameter in pixels. */ void gdImageArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color) { @@ -1681,8 +1679,8 @@ void gdImageArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int style) { - gdPoint pts[3]; - int i; + gdPoint pts[363]; + int i, pti; int lx = 0, ly = 0; int fx = 0, fy = 0; @@ -1710,7 +1708,7 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e } } - for (i = s; i <= e; i++) { + for (i = s, pti = 1; i <= e; i++, pti++) { int x, y; x = ((long) gdCosT[i % 360] * (long) w / (2 * 1024)) + cx; y = ((long) gdSinT[i % 360] * (long) h / (2 * 1024)) + cy; @@ -1719,19 +1717,28 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e if (style & gdNoFill) { gdImageLine(im, lx, ly, x, y, color); } else { - /* This is expensive! */ - pts[0].x = lx; - pts[0].y = ly; - pts[1].x = x; - pts[1].y = y; - pts[2].x = cx; - pts[2].y = cy; - gdImageFilledPolygon(im, pts, 3, color); - } + if (y == ly) { + pti--; /* don't add this point */ + if (((i > 270 || i < 90) && x > lx) || ((i > 90 && i < 270) && x < lx)) { + /* replace the old x coord, if increasing on the + right side or decreasing on the left side */ + pts[pti].x = x; + } + } else { + pts[pti].x = x; + pts[pti].y = y; + } + } } } else { fx = x; fy = y; + if (!(style & (gdChord | gdNoFill))) { + pts[0].x = cx; + pts[0].y = cy; + pts[pti].x = x; + pts[pti].y = y; + } } lx = x; ly = y; @@ -1758,6 +1765,10 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e gdImageLine(im, cx, cy, lx, ly, color); gdImageLine(im, cx, cy, fx, fy, color); } + } else { + pts[pti].x = cx; + pts[pti].y = cy; + gdImageFilledPolygon(im, pts, pti+1, color); } } } diff --git a/ext/gd/tests/bug43828.phpt b/ext/gd/tests/bug43828.phpt new file mode 100644 index 0000000000..05445608d3 --- /dev/null +++ b/ext/gd/tests/bug43828.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #43828 (broken transparency of imagearc for truecolor in blendingmode) +--SKIPIF-- +<?php +if (!extension_loaded('gd')) die('skip ext/gd not available'); +?> +--FILE-- +<?php + +$im = imagecreatetruecolor(100,100); + +$transparent = imagecolorallocatealpha($im, 255, 255, 255, 80); +imagefilledrectangle($im, 0,0, 99,99, $transparent); +$color = imagecolorallocatealpha($im, 0, 255, 0, 100); +imagefilledarc($im, 49, 49, 99,99, 0 , 360, $color, IMG_ARC_PIE); + +ob_start(); +imagepng($im); +echo md5(ob_get_clean()); +imagedestroy($im); +?> +--EXPECT-- +3d82e4525f19790ae1055366e2a36917 diff --git a/ext/gd/tests/imagecolorallocatealpha_basic.phpt b/ext/gd/tests/imagecolorallocatealpha_basic.phpt index bdc417387f..bb2e5a7f4f 100644 --- a/ext/gd/tests/imagecolorallocatealpha_basic.phpt +++ b/ext/gd/tests/imagecolorallocatealpha_basic.phpt @@ -26,5 +26,5 @@ var_dump(md5(base64_encode($imgsrc))); var_dump($corA); ?> --EXPECT-- -string(32) "2a6424e4cb4e1b7391dfff74bf136bde" +string(32) "f95489d97f4f1a5c4dc265388922d1ec" int(842163455)
\ No newline at end of file |