Brett
1d48da6da5
Fixed libpng warning when loading interlaced images
...
We enable interlace transform when reading png.
Closes GH-8002.
2022-02-08 10:46:50 +01:00
Christoph M. Becker
f22f4afd84
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix #71316 : libpng warning from imagecreatefromstring
2021-11-04 11:19:24 +01:00
Christoph M. Becker
1919c4b44d
Fix #71316 : libpng warning from imagecreatefromstring
...
We backport the respective upstream fix[1] to our bundled libgd.
[1] <636100b928 >
Closes GH-7615.
2021-11-04 11:16:45 +01:00
Christoph M. Becker
c0dcd141a8
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix gdAlphaMax limit typo
2021-09-23 23:18:52 +02:00
Michael Voříšek
2c3dfe5160
Fix gdAlphaMax limit typo
...
Closes GH-7410.
2021-09-23 23:16:40 +02:00
Christoph M. Becker
35e1f134f5
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix #53580 : During resize gdImageCopyResampled cause colors change
2021-08-26 18:41:08 +02:00
Christoph M. Becker
526407ca35
Fix #53580 : During resize gdImageCopyResampled cause colors change
...
We port the upstream fix[1], and also revert commit a3383ac3d7[2] which
is now obsolete, and also not part of libgd. Especially the change to
gd.png.c was at best a half-baked optimization.
[1] <a24e96f019 >
[2] <a3383ac3d7 >
Closes GH-7402.
2021-08-26 18:38:17 +02:00
Christoph M. Becker
213ad544e4
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix #51498 : imagefilledellipse does not work for large circles
2021-08-03 16:20:16 +02:00
Christoph M. Becker
c565555f03
Fix #51498 : imagefilledellipse does not work for large circles
...
We backport the respective upstream fix[1].
[1] <ace7fd88dc >
Closes GH-7329.
2021-08-03 16:17:47 +02:00
Christoph M. Becker
c455f49a6a
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix #81032 : GD install is affected by external libgd installation
2021-05-14 12:26:40 +02:00
Flavio Heleno
28e7addb9d
Fix #81032 : GD install is affected by external libgd installation
...
This PR replaces the bundled libgd includes from #include <foo.h> with
#include "foo.h" for gd-related headers to avoid including headers that
may be available in system directories instead of the expected local
headers.
Closes GH-6975.
2021-05-14 12:24:45 +02:00
Christoph M. Becker
ecf4e7063d
Merge branch 'PHP-7.4' into master
...
* PHP-7.4:
Fix potential integer overflow detected by oss-fuzz
2020-08-24 17:38:50 +02:00
Christoph M. Becker
5dd1877ca1
Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Fix potential integer overflow detected by oss-fuzz
2020-08-24 17:36:50 +02:00
Christoph M. Becker
74de17f2ea
Fix potential integer overflow detected by oss-fuzz
...
We port the respective fix from upstream[1].
[1] <9ed642764c >
2020-08-24 17:35:04 +02:00
Nikita Popov
ca48129cae
Return void from php_jpeg_emit_message()
...
Instead of returning long and then casting to void.
This fixes a build warning on Ubuntu 20.04.
Closes GH-5742.
2020-06-19 16:59:29 +02:00
Christoph M. Becker
b7a55aaff2
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Fix #79676 : imagescale adds black border with IMG_BICUBIC
2020-06-12 14:09:16 +02:00
Christoph M. Becker
ff7fd3dc85
Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Fix #79676 : imagescale adds black border with IMG_BICUBIC
2020-06-12 14:07:43 +02:00
Christoph M. Becker
86e1f0ea11
Fix #79676 : imagescale adds black border with IMG_BICUBIC
...
We have to loop over all image pixels to avoid the black border. This
is also done in external libgd in `_gdScaleOneAxis` and `_gdScalePass`.
2020-06-12 14:05:54 +02:00
Christoph M. Becker
7f51f43509
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Fix #79615 : Wrong GIF header written in GD GIFEncode
2020-05-22 09:22:38 +02:00
Christoph M. Becker
da801ba5e3
Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Fix #79615 : Wrong GIF header written in GD GIFEncode
2020-05-22 09:19:05 +02:00
Christoph M. Becker
d4bd6fb491
Fix #79615 : Wrong GIF header written in GD GIFEncode
...
The color resolution is expected in bits 4-6 of the packed fields byte
of the logical screen descriptor (byte 10 of the GIF data stream),
according to the specification[1], section 18.
[1] <https://www.w3.org/Graphics/GIF/spec-gif89a.txt >
2020-05-22 09:15:41 +02:00
George Peter Banyard
2f0dcf2ac2
Fix [-Wundef] warning in GD extension
2020-05-20 18:22:09 +02:00
Máté Kocsis
1f48feebb9
Improve some TypeError and ValueError messages
...
Closes GH-5377
2020-04-14 14:38:45 +02:00
George Peter Banyard
ac89139773
Fix [-Wtype-limits] in bundled GD lib by using signed integers
...
As seen in the gdImageRotateBicubicFixed() function the same setup
occurs but it uses signed integers, therefore we use also use
signed integers in gdImageRotateBilinear()
Moreover, these two functions have been removed upstream in
bd6d2e101f
therefore we should also mimic upstream and remove them...
Thanks to @cmb69 for pointing it out.
2020-02-06 01:34:09 +01:00
Máté Kocsis
d1764ca330
Make error messages more consistent by fixing capitalization
...
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Máté Kocsis
afdaa91170
Fix #78880 : Final spelling fixes
2020-01-16 19:14:31 +01:00
Christoph M. Becker
03bd4333f6
Add imagegetinterpolation()
...
While `imagesetinterpolation()` is available as of PHP 5.5.0,
there is no according getter function, so users would have to track the
current interpolation method manually.
To remedy this, we introduce `imagegetinterpolation()` as thin wrapper
for `gdImageGetInterpolationMethod()` (which has been introduced with
libgd 2.1.1), and use `im->interpolation_id` as fallback for older
libgd. Since our bundled libgd does not yet have this function, we add
it.
We also simplify the recently introduced bug79068.phpt, where it is
sufficient to check that the interpolation method has not been changed.
2020-01-14 18:25:27 +01:00
Christoph M. Becker
5836c7063b
Avoid superfluous assignments
...
These values are already set via the initializers.
2020-01-09 00:17:14 +01:00
Christoph M. Becker
be0b94c220
Fix hypothetical segfault in gdTransformAffineCopy()
...
This has been reported to upstream[1], but since ext/gd never calls
`gdTransformAffineCopy()` for a palette image, it is not a bug for PHP.
Therefore we apply the fix to master only.
[1] <https://github.com/libgd/libgd/issues/586 >
2020-01-06 13:25:11 +01:00
Christoph M. Becker
5c51a482c9
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Fix #79068 : gdTransformAffineCopy() changes interpolation method
2020-01-06 10:39:00 +01:00
Christoph M. Becker
74b11e3315
Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Fix #79068 : gdTransformAffineCopy() changes interpolation method
2020-01-06 10:38:22 +01:00
Christoph M. Becker
4bec59f175
Fix #79068 : gdTransformAffineCopy() changes interpolation method
...
We port
<9088591eae >.
2020-01-06 10:36:48 +01:00
Christoph M. Becker
bc04d5e9fc
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Fix #79067 : gdTransformAffineCopy() may use unitialized values
2020-01-06 09:38:19 +01:00
Christoph M. Becker
f799f42ec8
Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Fix #79067 : gdTransformAffineCopy() may use unitialized values
2020-01-06 09:37:40 +01:00
Christoph M. Becker
2c5860517c
Fix #79067 : gdTransformAffineCopy() may use unitialized values
...
We port
<7a06c1669c >.
2020-01-06 09:35:13 +01:00
Christoph M. Becker
2ede8db1b4
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Fix #78923 : Artifacts when convoluting image with transparency
2019-12-07 12:09:16 +01:00
Christoph M. Becker
aba070e630
Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Fix #78923 : Artifacts when convoluting image with transparency
2019-12-07 12:08:30 +01:00
willson-chen
b5d2cbe027
Fix #78923 : Artifacts when convoluting image with transparency
...
We have to properly initialize `pxl` before using it.
Fix ported from <https://github.com/libgd/libgd/pull/559 >.
2019-12-07 12:06:33 +01:00
Christoph M. Becker
b40799efcd
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Fix #78849 : GD build broken with -D SIGNED_COMPARE_SLOW
2019-11-21 10:04:03 +01:00
Christoph M. Becker
b78ec58f09
Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Fix #78849 : GD build broken with -D SIGNED_COMPARE_SLOW
2019-11-21 10:02:33 +01:00
Christoph M. Becker
b4f501d5a4
Merge branch 'PHP-7.2' into PHP-7.3
...
* PHP-7.2:
Fix #78849 : GD build broken with -D SIGNED_COMPARE_SLOW
2019-11-21 10:01:05 +01:00
Christoph M. Becker
9b92c1d154
Fix #78849 : GD build broken with -D SIGNED_COMPARE_SLOW
...
Apparently, this has not been tested for a long time, and might be a
refactoring relict. Anyhow, we have to pass the context to
`GIFNextPixel` as well.
2019-11-21 09:59:26 +01:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
...
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Christoph M. Becker
f8202b5513
Remove superfluous HAVE_GD_BUNDLED checks
...
If we're compiling the bundled libgd, `HAVE_GD_BUNDLED` is set, so
there is no need to check for this macro again.
2019-07-22 15:59:44 +02:00
Peter Kokot
48abed7fd8
Use e.g. instead of less common f.e. [ci skip]
2019-07-09 17:53:46 +02:00
Peter Kokot
a014e50513
Remove HAVE_ERRNO_H from libgd
...
The check for errno.h has been removed via
50b9ef8d94
Upstream libgd library is also patched via
1e7f93922f
2019-06-28 20:02:11 +02:00
Christoph M. Becker
81fd113506
Support TGA reading
...
We add PHP bindings for libgd's features to read TGA 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.
Since TGA has no easily recognizable file signature, we don't add TGA
support for imagecreatefromstring() or getimagesize() and friends.
2019-06-20 23:40:51 +02:00
Nikita Popov
9b3b07cd26
Suppress shift UB in gd_itofx()
...
There doesn't seem to be a corresponding upstream fix for this.
2019-06-19 17:27:09 +02:00
Nikita Popov
2a9fc31021
Fix buffer underflow in gd_gif_in.c
...
This has been fixed upstream in
939d49a3a9 .
2019-06-19 15:41:45 +02:00
Nikita Popov
ea97fc9c1f
Fix shift UB in gd_io.c
...
This has already been fixed upstream in
24d352576c
and
772d0107a6 .
2019-06-19 15:09:00 +02:00