mirror of
https://github.com/php/php-src.git
synced 2024-09-29 05:46:06 +00:00
Merge branch 'PHP-7.0' into PHP-7.1
This commit is contained in:
commit
bc9efac0fe
1
NEWS
1
NEWS
@ -14,6 +14,7 @@ PHP NEWS
|
||||
. Fixed bug #53504 (imagettfbbox gives incorrect values for bounding box).
|
||||
(Mark Plomer, cmb)
|
||||
. Fixed bug #73157 (imagegd2() ignores 3rd param if 4 are given). (cmb)
|
||||
. Fixed bug #73155 (imagegd2() writes wrong chunk sizes on boundaries). (cmb)
|
||||
|
||||
- JSON:
|
||||
. Fixed bug #73113 (Segfault with throwing JsonSerializable). (julien)
|
||||
|
@ -689,8 +689,8 @@ static void _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt)
|
||||
}
|
||||
|
||||
/* Work out number of chunks. */
|
||||
ncx = im->sx / cs + 1;
|
||||
ncy = im->sy / cs + 1;
|
||||
ncx = (im->sx + cs - 1) / cs;
|
||||
ncy = (im->sy + cs - 1) / cs;
|
||||
|
||||
/* Write the standard header. */
|
||||
_gd2PutHeader (im, out, cs, fmt, ncx, ncy);
|
||||
|
28
ext/gd/tests/bug73155.phpt
Normal file
28
ext/gd/tests/bug73155.phpt
Normal file
@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #73155 (imagegd2() writes wrong chunk sizes on boundaries)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreate(64, 64);
|
||||
imagecolorallocate($im, 0, 0, 0);
|
||||
|
||||
ob_start();
|
||||
imagegd2($im, null, 64, IMG_GD2_RAW);
|
||||
$buffer = ob_get_clean();
|
||||
|
||||
$header = unpack('@10/nchunk_size/nformat/nx_count/ny_count', $buffer);
|
||||
printf("chunk size: %d\n", $header['chunk_size']);
|
||||
printf("x chunk count: %d\n", $header['x_count']);
|
||||
printf("y chunk count: %d\n", $header['y_count']);
|
||||
printf("file size: %d\n", strlen($buffer));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
chunk size: 64
|
||||
x chunk count: 1
|
||||
y chunk count: 1
|
||||
file size: 5145
|
||||
===DONE===
|
Loading…
Reference in New Issue
Block a user