Commit graph

1761 commits

Author SHA1 Message Date
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