Commit Graph

1836 Commits

Author SHA1 Message Date
Christoph M. Becker
d2274b01cb Fix #73869: Signed Integer Overflow gd_io.c
GD2 stores the number of horizontal and vertical chunks as words (i.e. 2
byte unsigned). These values are multiplied and assigned to an int when
reading the image, what can cause integer overflows. We have to avoid
that, and also make sure that either chunk count is actually greater
than zero. If illegal chunk counts are detected, we bail out from
reading the image.

(cherry picked from commit 5b5d9db3988b829e0b121b74bb3947f01c2796a1)
2017-01-17 09:30:58 +01:00
Christoph M. Becker
f1b2afc9d9 Fix #73868: DOS vulnerability in gdImageCreateFromGd2Ctx()
We must not pretend that there are image data if there are none. Instead
we fail reading the image file gracefully.

(cherry picked from commit cdb648dc4115ce0722f3cc75e6a65115fc0e56ab)
2017-01-17 09:30:43 +01:00
Christoph M. Becker
703c0043a0 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fix #73893: A hidden danger of death cycle in a function of gd

# Conflicts:
#	ext/gd/libgd/gd_rotate.c
2017-01-10 20:15:05 +01:00
Christoph M. Becker
fc46003666 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix #73893: A hidden danger of death cycle in a function of gd
2017-01-10 20:13:16 +01:00
Christoph M. Becker
15837bab8c Fix #73893: A hidden danger of death cycle in a function of gd
We remove the unused, but potentially dangerous functions.
2017-01-10 19:52:06 +01:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Christoph M. Becker
500b496f8e Implement #69606: Support BMPs (added in GD 2.1.0)
We add PHP bindings for libgd's features to read and write BMP files, which
are available as of libgd 2.1.0.

As PHP's bundled libgd doesn't yet include the respective features of the
external libgd, we add these.
2017-01-04 14:55:02 +01:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Stanislav Malyshev
76c02dcdf7 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fix #73549: Use after free when stream is passed to imagepng
2016-11-27 14:54:19 -08:00
Stanislav Malyshev
8cc42537d2 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix #73549: Use after free when stream is passed to imagepng
2016-11-27 14:53:39 -08:00
Stanislav Malyshev
1cb58ead70 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix #73549: Use after free when stream is passed to imagepng
2016-11-27 14:53:27 -08:00
Christoph M. Becker
5049ef2f1c Fix #73549: Use after free when stream is passed to imagepng
If a stream is passed to imagepng() or other image output functions,
opposed to a filename, we must not close this stream.
2016-11-27 14:51:02 -08:00
Christoph M. Becker
a35359f8b7 Merge branch 'PHP-7.1' 2016-11-25 23:33:02 +01:00
Christoph M. Becker
51ba53ed0f Merge branch 'PHP-7.0' into PHP-7.1 2016-11-25 23:27:13 +01:00
Christoph M. Becker
bc979aee6d Merge branch 'PHP-5.6' into PHP-7.0 2016-11-25 23:16:18 +01:00
Christoph M. Becker
7f529e3dee Fix #73582: Failing ext/gd/tests/imagettftext_charmap_order.phpt
This test is not supposed to work with JIS-mapped Japanese font support
enabled.
2016-11-25 23:14:08 +01:00
Nikita Popov
5af586bec5 Remove more PHP 6 leftovers from tests 2016-11-24 22:39:39 +01:00
Anatol Belski
bfb9be9bd4 Merge branch 'PHP-7.1'
* PHP-7.1:
  remove TSRMLS_*
2016-11-22 00:33:29 +01:00
Anatol Belski
d61db8d602 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  remove TSRMLS_*
2016-11-22 00:32:42 +01:00
Anatol Belski
5e9b4c26a5 remove TSRMLS_* 2016-11-21 23:53:37 +01:00
Nikita Popov
45f7b2bcc8 Fix CRLF line-endings in tests
Also fix a single instance of CRLF in ibase_query.c.
2016-11-20 22:31:24 +01:00
Christoph M. Becker
189bbb586c Merge branch 'pull-request/2164' 2016-11-13 23:31:40 +01:00
Anatol Belski
a75827b4f9 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crash
  Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crash
  Fix #72696: imagefilltoborder stackoverflow on truecolor images
  Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
  Fix bug #73144 and bug #73341 - remove extra dtor
  remove unreferenced var came in with merge
  Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
  Fix #72696: imagefilltoborder stackoverflow on truecolor images
  Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
  fix version
  set versions
  Fix bug #73144 and bug #73341 - remove extra dtor
  Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
2016-11-08 11:16:55 +01:00
Anatol Belski
9b81342352 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crash
  Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crash
  Fix #72696: imagefilltoborder stackoverflow on truecolor images
  Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
  Fix bug #73144 and bug #73341 - remove extra dtor
  remove unreferenced var came in with merge
  Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
  Fix #72696: imagefilltoborder stackoverflow on truecolor images
  Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
  fix version
  set versions
  Fix bug #73144 and bug #73341 - remove extra dtor
  Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
2016-11-08 11:15:06 +01:00
Anatol Belski
2b30b54275 Merge remote-tracking branch 'phpsec/PHP-7.0.13' into PHP-7.0
* phpsec/PHP-7.0.13:
  Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crash
  Fix #72696: imagefilltoborder stackoverflow on truecolor images
  Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
  Fix bug #73144 and bug #73341 - remove extra dtor
  remove unreferenced var came in with merge
  Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
  fix version
  set versions
2016-11-08 11:13:29 +01:00
Anatol Belski
33766347cb Merge remote-tracking branch 'phpsec/PHP-5.6.28' into PHP-5.6 2016-11-08 11:06:52 +01:00
Christoph M. Becker
5693474997 Fix #72696: imagefilltoborder stackoverflow on truecolor images
We must not allow negative color values be passed to
gdImageFillToBorder(), because that can lead to infinite recursion
since the recursion termination condition will not necessarily be met.

(cherry picked from commit 863d37ea66)
2016-11-01 13:07:37 +01:00
Christoph M. Becker
1b5543b8ab Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
Instead of rolling our own bounds check we use clip_1d() as it's done
in gdImageLine() and in external libgd. We must not pass the image
width and height, respectively, but rather the largest ordinate value
that is allowed to be accessed, i.e. width-1 and height-1,
respectively.

(cherry picked from commit 6499581af7)
2016-11-01 13:03:41 +01:00
Christoph M. Becker
863d37ea66 Fix #72696: imagefilltoborder stackoverflow on truecolor images
We must not allow negative color values be passed to
gdImageFillToBorder(), because that can lead to infinite recursion
since the recursion termination condition will not necessarily be met.
2016-10-30 14:31:29 -07:00
Christoph M. Becker
6499581af7 Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
Instead of rolling our own bounds check we use clip_1d() as it's done
in gdImageLine() and in external libgd. We must not pass the image
width and height, respectively, but rather the largest ordinate value
that is allowed to be accessed, i.e. width-1 and height-1,
respectively.
2016-10-30 14:28:23 -07:00
Christoph M. Becker
c8c8c0b52c Merge branch 'PHP-7.1' 2016-10-25 14:41:00 +02:00
Christoph M. Becker
c30e5a32c1 Merge branch 'PHP-7.0' into PHP-7.1 2016-10-25 14:35:38 +02:00
Christoph M. Becker
af4bfe234c Merge branch 'PHP-5.6' into PHP-7.0 2016-10-25 14:31:41 +02:00
Christoph M. Becker
cd13d0260a Fix #72494: imagecropauto out-of-bounds access
This issue has actually already been fixed with commit 46f2c690. We're
adding a regression test and a NEWS entry, and also port the fix in
gdImageCropThreshold() from libgd:
  * <https://github.com/libgd/libgd/commit/b347e034>
  * <https://github.com/libgd/libgd/commit/46f2c690>
2016-10-25 14:29:48 +02:00
Joe Watkins
e0b6ac2976 Merge branch 'pull-request/2135' 2016-10-20 05:33:12 +01:00
Christoph M. Becker
371f41250c Remove superfluous checks for PNG support
PNG support is required to build ext/gd, so there's no need to check
for it in the tests.
2016-10-18 14:17:37 +02:00
Christoph M. Becker
209d4220d5 Add PHP bindings for setting and getting the image resolution
We expose the image resolution related GD functionality to userland
by introducing `imageresolution()` as getter/setter. Given only the
image argument, it returns the current resolution as indexed array.
Given only a second argument, it sets the horizontal and vertical
resolution to this value. Given three arguments, it sets the horizontal
and vertical resolution to the given arguments, respectively.
2016-10-18 01:53:39 +02:00
Christoph M. Becker
0f49aa3287 Merge branch 'pull-request/2151' 2016-10-17 10:37:38 +02:00
Christoph M. Becker
1aaa560d85 Mark functions as PHP_DEP_FE instead of manually emitting the notice 2016-10-15 23:41:33 +02:00
Christoph M. Becker
1490446ce0 RFC: Deprecate png2wbmp() and jpegwbmp()
See <https://wiki.php.net/rfc/deprecate-png-jpeg-2wbmp>.
2016-10-15 16:16:34 +02:00
Christoph M. Becker
0864915550 Fix #73280: Stack Buffer Overflow in GD dynamicGetbuf
We make sure to never pass a negative `rlen` as size to memcpy().

Cf. <https://github.com/libgd/libgd/commit/53110871>.

(cherry picked from commit cc08cbc84d)
2016-10-14 02:02:42 +02:00
Christoph M. Becker
c31eb5a407 Remove unused code
There is no gif2wbmp() or such, and it is highly unlikely that it'll be
ever added, so we remove the unused code.
2016-10-13 15:35:10 +02:00
Anatol Belski
19605950fc add missing header for gd_error 2016-10-13 14:40:37 +02:00
Anatol Belski
fa45124138 fix syslog interference 2016-10-13 14:40:37 +02:00
Christoph M. Becker
a9209588d5 Merge branch 'PHP-7.0' into PHP-7.1 2016-10-13 11:31:37 +02:00
Christoph M. Becker
b8fab503fe Merge branch 'PHP-5.6' into PHP-7.0 2016-10-13 11:25:11 +02:00
Christoph M. Becker
cc08cbc84d Fix #73280: Stack Buffer Overflow in GD dynamicGetbuf
We make sure to never pass a negative `rlen` as size to memcpy().

Cf. <https://github.com/libgd/libgd/commit/53110871>.
2016-10-13 11:10:02 +02:00
Christoph M. Becker
4be36b536e Merge branch 'PHP-7.1' 2016-10-10 12:13:07 +02:00
Christoph M. Becker
0f40ca989a Merge branch 'PHP-7.0' into PHP-7.1 2016-10-10 12:12:13 +02:00
Christoph M. Becker
fb08216b08 Merge branch 'PHP-5.6' into PHP-7.0 2016-10-10 11:45:53 +02:00
Christoph M. Becker
fc989fc6e7 Fix #73279: Integer overflow in gdImageScaleBilinearPalette()
The color components are supposed to be in range 0..255, so we must not
cast them to `signed char`, what can be the default for `char`.

Port of <https://github.com/libgd/libgd/commit/77c8d359>.
2016-10-10 11:41:39 +02:00
Christoph M. Becker
7ce90014e2 Merge branch 'PHP-7.1' 2016-10-09 15:27:14 +02:00
Christoph M. Becker
a16f0c5e01 Merge branch 'PHP-7.0' into PHP-7.1 2016-10-09 15:21:40 +02:00
Christoph M. Becker
c930714cbe Merge branch 'PHP-5.6' into PHP-7.0 2016-10-09 15:14:17 +02:00
Christoph M. Becker
b92216b97d Fix #73272: imagescale() affects imagesetinterpolation()
We must not permanently change the interpolation method, but rather
have to restore the old method after we're done with scaling the image.
2016-10-09 15:10:34 +02:00
Christoph M. Becker
432e16cb58 Unify error handling of bundled and external libgd
There's no need anymore to call an own error handler directly. Instead we
register our error handler and call libgd's error functions (which will
forward). We do this regardless of compiling with the bundled or an external
libgd.
2016-10-07 01:13:49 +02:00
Christoph M. Becker
2b134a1dcb Move freeing of truecolor pixels to a function
We port <https://github.com/libgd/libgd/commit/81675d39>.
2016-10-03 12:11:46 +02:00
Christoph M. Becker
ec591b555f Change gdImageTrueColorToPalette() to return success/failure
We're porting the relevant changes from
<https://github.com/libgd/libgd/commit/34a00a40>.

We also check the return value in the PHP binding, and throw E_WARNING if
the conversion failed.
2016-10-03 12:02:31 +02:00
Christoph M. Becker
2a305b38b7 Implement request #33066: Add GD Image Function gdImageOpenPolygon()
gdImageOpenPolygon() has been introduced with líbgd 2.0.29, so we finally
add a PHP binding for it, and port the respective libgd functionality to
PHP's bundled libgd.
2016-10-02 20:27:58 +02:00
Christoph M. Becker
82a8e57f37 Add support for gdEffectMultiply
gdLayerMultiply() has been introduced in libgd 2.1.1, and as such would have
been already available for imagelayereffect() with a system libgd. We port
the respective code to the bundled libgd, and also make IMG_EFFECT_MULTIPLY
available to userland.
2016-10-02 19:10:13 +02:00
Christoph M. Becker
d0f14a4429 Switch to libgd anti-aliased drawing API
Instead of rolling our own in the bundled libgd, we use libgd's anti-aliased
drawing API. This way imageantialias() is also available, when built against
a system libgd.
2016-10-02 13:16:40 +02:00
Christoph M. Becker
0e38932d14 Merge branch 'PHP-7.1' 2016-10-01 00:02:05 +02:00
Christoph M. Becker
f6da70863f Merge branch 'PHP-7.0' into PHP-7.1 2016-10-01 00:00:46 +02:00
Christoph M. Becker
12967bc346 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-30 23:54:18 +02:00
Christoph M. Becker
9acfb1a3a5 Fix #73213: Integer overflow in imageline() with antialiasing
We port the respective fixes <https://github.com/libgd/libgd/commit/eca37d620>
and <https://github.com/libgd/libgd/commit/837b7327> to our bundled libgd.
2016-09-30 23:38:13 +02:00
Christoph M. Becker
c60cdac636 Fix overflow checks
We check for the proper sizeofs, cf.
<https://github.com/libgd/libgd/commit/c3cf674c>.
2016-09-30 20:15:15 +02:00
Christoph M. Becker
e3b889700b Remove further remains of the old antialiasing support
Curiously, while the external GD claims "just a few vestiges after switching
to the fast, memory-cheap implementation from PHP-gd", that stuff was still
in the bundled GD.
2016-09-30 17:04:37 +02:00
Christoph M. Becker
04400b19fc Remove basically effectless gdImageAABlend()
This had already be done for GD 2.0.26 as part of the improved antialiasing
support (<https://boutell.com/gd/manual2.0.26.html#whatsnew2.0.26>).
2016-09-30 16:12:47 +02:00
Anatol Belski
56ff613974 Merge branch 'PHP-7.1'
* PHP-7.1:
  Add an include path for freetype which is relevant for cmake builds
2016-09-25 20:58:09 +02:00
Anatol Belski
2b8024bb04 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Add an include path for freetype which is relevant for cmake builds
2016-09-25 20:57:30 +02:00
Anatol Belski
4e7b5ca459 Add an include path for freetype which is relevant for cmake builds 2016-09-25 20:55:13 +02:00
Christoph M. Becker
65ee87f20d Refactor imagegammacorrect()
We apply the law `(b**r)**s == b**(r*s)` which holds for all non-negative b
and positive r,s, so a single pow() suffices. Furthermore, we precompute the
gamma, so the refactored code is simpler and faster.
2016-09-25 11:28:39 +02:00
Christoph M. Becker
47f1666f7c Merge branch 'PHP-7.1' 2016-09-25 10:57:23 +02:00
Christoph M. Becker
daba342f57 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-25 10:49:43 +02:00
Christoph M. Becker
fa9d41f66c Merge branch 'PHP-5.6' into PHP-7.0 2016-09-25 10:46:44 +02:00
Christoph M. Becker
c696bc8cfa Fix test_image_equals_file() wrt. palette images
The recently introduced test_image_equals_file() doesn't properly work for
palette images, because in this case only the palette indexes are compared,
what can lead to false positives and negatives as shown in the added test.

To fix that we convert palette images to truecolor, what is supposed to be
faster than calling imagecolorsforindex() for each pixel.

We furthermore rely on PHP's refcounting to free unused images; after all,
this is not C.
2016-09-25 10:34:03 +02:00
Christoph M. Becker
2e1d20a28b Merge branch 'pull-request/2026' 2016-09-24 15:41:55 +02:00
Christoph M. Becker
d95b8eaf31 Don't enforce palette conversion when writing GD images
The GD image format is able to handle truecolor images as of libgd 2.0.12
(<https://github.com/libgd/libgd/blob/gd-2.2.3/src/gd_gd.c#L31-L33>).
Therefore we don't need the potentially lossy and time consuming palette
conversion.

This way, imagegd() can also be used to export raw truecolor image data.
2016-09-24 14:46:37 +02:00
Christoph M. Becker
68b1d4c299 Merge branch 'PHP-7.1' 2016-09-24 12:52:14 +02:00
Christoph M. Becker
c733f92d72 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-24 12:47:07 +02:00
Christoph M. Becker
5c81298597 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-24 12:41:48 +02:00
Christoph M. Becker
8f5eda4bf6 Fix #73161: imagecreatefromgd2() may leak memory 2016-09-24 12:36:54 +02:00
Christoph M. Becker
9e7ccba7c9 Merge branch 'PHP-7.1' 2016-09-24 11:42:55 +02:00
Christoph M. Becker
394e9b3d15 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-24 11:37:23 +02:00
Christoph M. Becker
61722743f4 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-24 11:31:54 +02:00
Christoph M. Becker
709731797c Fix #73159: imagegd2(): unrecognized formats may result in corrupted files
We must not apply the format correction twice for truecolor images.
2016-09-24 11:28:20 +02:00
Christoph M. Becker
cf5c2acbb4 Merge branch 'PHP-7.1' 2016-09-24 11:03:46 +02:00
Christoph M. Becker
bc9efac0fe Merge branch 'PHP-7.0' into PHP-7.1 2016-09-24 10:58:39 +02:00
Christoph M. Becker
0a4b72fa94 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-24 10:48:24 +02:00
Christoph M. Becker
c7936ead8f Fix #73155: imagegd2() writes wrong chunk sizes on boundaries 2016-09-24 10:33:49 +02:00
Christoph M. Becker
1da79a6c6e Fix #73157 (again): imagegd2() ignores 3rd param if 4 are given
Obviously, there was a bad merge.
2016-09-24 00:35:24 +02:00
Christoph M. Becker
9482932251 Merge branch 'PHP-7.1' 2016-09-24 00:13:36 +02:00
Christoph M. Becker
bf66af1d60 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-24 00:07:50 +02:00
Christoph M. Becker
456be3ec37 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-23 23:46:22 +02:00
Christoph M. Becker
c240978067 Fix #73157: imagegd2() ignores 3rd param if 4 are given
We must initialize `q` for *more* than three parameters, too.
2016-09-23 23:42:34 +02:00
Christoph M. Becker
c1eb7d7bf0 Merge branch 'PHP-7.1' 2016-09-23 15:50:25 +02:00
Christoph M. Becker
bf35b31f56 Fix FreeType tests using UTF-8 font file names
UTF-8 font file names are not yet supported on Windows[1], so we're skipping
the respective tests on this platform, but enable them on other platforms.

[1] <http://news.php.net/php.internals.win/1142>
2016-09-23 15:49:21 +02:00
Christoph M. Becker
4ba11af40f Merge branch 'PHP-7.1' 2016-09-23 13:11:14 +02:00
Christoph M. Becker
8dfee1a777 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-23 12:57:10 +02:00
Christoph M. Becker
deda058751 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-23 12:29:37 +02:00
Christoph M. Becker
726c5999eb Rework FreeType related tests
Firstly, there is no fundamental difference between running the tests on
freetype before and after 2.4.10, so we re-join the respective test cases.

Secondly, there are some minor differences in the results depending on
architecture, freetype versions and config options, so we cater to that
by allowing small deviations from the expectations.
2016-09-23 12:00:41 +02:00
Christoph M. Becker
ea52b84635 Merge branch 'PHP-7.1' 2016-09-20 12:18:55 +02:00
Christoph M. Becker
7e21cb0c99 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-20 12:18:13 +02:00
Christoph M. Becker
eeb9113b6c Skip failing FreeType tests for now 2016-09-20 12:16:16 +02:00
Christoph M. Becker
dc59aafa77 Merge branch 'PHP-7.1' 2016-09-20 01:38:28 +02:00
Christoph M. Becker
474428943f Merge branch 'PHP-7.0' into PHP-7.1 2016-09-20 01:32:32 +02:00
Christoph M. Becker
ba2d9e1ff1 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-20 01:25:08 +02:00
Christoph M. Becker
fc2cadca2d Merge branch 'pull-request/1845' into PHP-5.6 2016-09-20 01:05:57 +02:00
Christoph M. Becker
be30c34fb8 Sync with libgd wrt. compilation units
* integrate gd_arc.c into gd.c (as of gd-2.1.0-alpha1)
 * rename gd_color.c to gd_color_match.c (as of gd-2.1.0-alpha1)
 * remove mathmake.c (as of GD_2_0_34RC1)
 * rename xbm.c to gd_xbm.c (as of gd-2.1.0-alpha1)
2016-09-20 00:34:19 +02:00
Christoph M. Becker
a14c220fd9 Remove unused compilation unit
gd_arc_f_buggy.c has already been removed in GD 2.0.34RC, so we're also
getting rid of the file.
2016-09-19 23:48:23 +02:00
Christoph M. Becker
932c20fb8d Port variable image resolution support from libgd 2.1.0
The PHP binding for this feature will be submitted as a separate PR.
2016-09-19 19:00:58 +02:00
Christoph M. Becker
77ba2483d9 Port gdImageSetStyle() overflow check from libgd 2.0.29 2016-09-19 16:56:07 +02:00
Christoph M. Becker
3c2de0a534 Merge branch 'PHP-7.1' 2016-09-16 11:54:18 +02:00
Christoph M. Becker
a8a123e36c Merge branch 'PHP-7.0' into PHP-7.1 2016-09-16 11:48:53 +02:00
Christoph M. Becker
c18263e0e0 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-16 11:41:42 +02:00
Christoph M. Becker
46df064261 Fix #73003: Integer Overflow in gdImageWebpCtx of gd_webp.c
We add the missing integer overflow check to avoid potential buffer overflows.
2016-09-16 11:37:18 +02:00
Christoph M. Becker
ba2b50d097 Port optimization from external libgd
The functionality is identical, but we save two function calls for partially
transparent pixels.
2016-09-15 13:24:43 +02:00
Christoph M. Becker
04b166a6c5 Removed unused function
The earlier gdAlphaBlend() has been replaced with commit 1286d9e2, and has
been renamed to gdAlphaBlendOld(). The old function is, however, not used,
and after more than 9 years we're pretty sure we won't need it anymore.
2016-09-15 13:04:30 +02:00
Christoph M. Becker
fca15a6b75 Merge branch 'PHP-7.1' 2016-09-15 01:08:29 +02:00
Christoph M. Becker
41001f8bb5 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-15 00:55:41 +02:00
Christoph M. Becker
cf9e2fbbf6 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-15 00:50:49 +02:00
Christoph M. Becker
7bfb7b62b1 Fix and reactivate regression test for bug #50194
Apparently, different FreeType versions render the string differently, so
we have to cater to these slight differences. Unfortunately, the testing
framework doesn't yet offer a clean API for this, so we work around the
limitations by parsing and checking the output of test_image_equals_file().
2016-09-15 00:46:00 +02:00
Christoph M. Becker
dbdc7cb057 Remove unnecessary #ifdef
The bundled libgd also defines gdImageAlphaBlending(), and this is the
preferred way to set the alphaBlendingFlag member anyway.
2016-09-14 23:38:02 +02:00
Christoph M. Becker
10fe6afc35 Merge branch 'PHP-7.1' 2016-09-14 20:03:42 +02:00
Christoph M. Becker
1c8c61f142 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-14 20:03:00 +02:00
Christoph M. Becker
7a923c3afe Merge branch 'PHP-5.6' into PHP-7.0 2016-09-14 20:02:05 +02:00
Christoph M. Becker
36df4f8419 Skip ext/gd/tests/bug50194.phpt for now
There are apparently issues with the font rendering with different freetype
version; I'll have a look at this issue ASAP.
2016-09-14 20:00:30 +02:00
Christoph M. Becker
f81f40fbd3 Remove unused code which is also not there in external libgd 2016-09-14 17:01:41 +02:00
Christoph M. Becker
aad54b7c5f Merge branch 'PHP-7.1' 2016-09-14 16:11:04 +02:00
Christoph M. Becker
b1a65452a1 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-14 16:01:02 +02:00
Christoph M. Becker
bc27ce98ee Merge branch 'PHP-5.6' into PHP-7.0 2016-09-14 15:50:09 +02:00
Christoph M. Becker
09eb6ed35e Fix #50194: imagettftext broken on transparent background w/o alphablending
We must not draw the background pixels of the character glyphs, what has
already been fixed in GD 2.0.26.
2016-09-14 15:47:32 +02:00
Christoph M. Becker
494c5dc77a Remove effectless --enable-gd-native-ttf and USE_GD_IMGSTRTTF
--enable-gd-native-ttf did set USE_GD_IMGSTRTTF, which is otherwise unused
as of commit 8a90aad3 (i.e. PHP 5.5.0), at least.
2016-09-14 01:01:19 +02:00
Christoph M. Becker
abb90fbc34 Refactor according to libgd
Cf. <https://github.com/libgd/libgd/commit/a3016ad0>.
2016-09-12 22:37:32 +02:00
Christoph M. Becker
01e798fa36 Merge branch 'PHP-7.1' 2016-09-12 13:45:26 +02:00
Christoph M. Becker
c7adfeb6c6 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-12 13:36:24 +02:00
Christoph M. Becker
82fa85fd08 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-12 13:27:57 +02:00
Christoph M. Becker
0cbf634657 Skip regression test for issue that has not yet been released in libgd
<https://github.com/libgd/libgd/issues/177> has been assessed as enhancement,
so most likely it will be released with GD 2.3.
2016-09-12 13:21:34 +02:00
Christoph M. Becker
e3e4932040 Merge branch 'PHP-7.1' 2016-09-12 12:50:45 +02:00
Christoph M. Becker
6ef0b09948 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-12 12:44:49 +02:00
Christoph M. Becker
c2044e60f3 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-12 12:39:14 +02:00
Christoph M. Becker
fcdc30b347 Skip test for external GD because of not yet published bugfix 2016-09-12 12:34:11 +02:00
Christoph M. Becker
ca5cfacffc Merge branch 'PHP-7.1' 2016-09-12 00:08:16 +02:00
Christoph M. Becker
6c3f90cab9 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-12 00:03:56 +02:00
Christoph M. Becker
c02cfd4e25 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-11 23:51:32 +02:00
Andrea Faulds
3cc9090101 Remove remaining zpp fallback code (master branch)
Follow-up to d690014bf3
2016-09-11 22:50:24 +01:00
Christoph M. Becker
6d0e773292 Skip tests for unpatched external libgd regarding libvpx
Some issues have never been fixed in the external libgd's libvpx binding,
so we skip the respective tests.
2016-09-11 23:49:09 +02:00
Christoph M. Becker
7b21230663 Merge branch 'PHP-7.1' 2016-09-11 23:08:44 +02:00
Christoph M. Becker
c90f7f66ea Merge branch 'PHP-7.0' into PHP-7.1 2016-09-11 23:03:58 +02:00