David Carlier
fc73da57f4
Merge branch 'PHP-8.3' into PHP-8.4
2025-02-24 07:14:56 +00:00
Michael Orlitzky
174a7fe6f9
Fix GH-17891 gh17373.phpt test issue without freetype support
...
skip if imagefttext() is not available
This test calls imagefttext(), which may not be available if libgd
was built without freetype support.
Closes GH-17910
2025-02-24 07:13:11 +00:00
Michael Orlitzky
065b4ec125
ext/gd/tests: backport optional PNG support
...
- Three of our gd tests could be skipped with a message about requiring
bundled GD, but those tests don't actually require bundled GD. We
update the messages to mention the specific functions that are
required.
- add SKIPIF stanzas for missing PNG support
The bundled libgd always has PNG support, but an external one may not.
- imagerotate() is always available
Following 59ec80c5 , the imagerotate() function is always available. We
may therefore remove its function_exists() checks without harm.
close GH-17894
2025-02-23 16:01:30 +00:00
David Carlier
ed18fd073a
Merge branch 'PHP-8.3' into PHP-8.4
2025-02-14 15:28:48 +00:00
David Carlier
4d7d01d18e
Fix GH-17772: imagepalettetotruecolor segfault on invalid truecolor pixel.
...
close GH-17777
2025-02-14 15:28:33 +00:00
David Carlier
dc7b661a60
Fix GH-17703: imagescale both width and heigh set with negative values.
...
Throwing a ValueError in this particular case.
close GH-17708
2025-02-05 19:39:51 +00:00
Christoph M. Becker
38365a44d0
Add support for reading GIFs without colormap
...
Cf. <https://github.com/libgd/libgd/commit/fc38677e8005c24db891b84d3e84df7a199c979c >.
Closes GH-17364.
2025-01-09 12:06:24 +01:00
Christoph M. Becker
12e4ee492b
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Fix libgd 223: gdImageRotateGeneric() does not properly interpolate
2025-01-06 20:38:34 +01:00
Christoph M. Becker
47683487f8
Fix libgd 223: gdImageRotateGeneric() does not properly interpolate
...
We port the respective upstream fix[1]. We only run the test against
bundled libgd, since external libgd may yield different results.
Cf. <https://github.com/libgd/libgd/commit/2b26be874d0c0987c4906a40ef8f0e8fee04ae8f >.
Closes GH-17380.
2025-01-06 20:37:23 +01:00
Christoph M. Becker
61dcfc4c9a
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Fix GH-17373: imagefttext() ignores clipping rect for palette images
2025-01-06 14:59:03 +01:00
Christoph M. Becker
ec90367cd8
Fix GH-17373: imagefttext() ignores clipping rect for palette images
...
We apply the same fix that has been applied to external libgd at least
as of 2.0.29.
To avoid issues regarding minor FreeType rendering differences, the
test case does not compare against an image, but rather checks that all
pixels outside the clipping rect have the background color.
Closes GH-17374.
2025-01-06 14:57:46 +01:00
Christoph M. Becker
5a01c3293a
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Fix GH-17349: Tiled truecolor filling looses single color transparency
2025-01-04 14:54:11 +01:00
Christoph M. Becker
2c658f422d
Fix GH-17349: Tiled truecolor filling looses single color transparency
...
This is porting the relevant part of a previous upstream commit[1] to
align the behavior of our bundled libgd with upstream. It should be
noted that this only works if the image actually has a transparent
color.
[1] <https://github.com/libgd/libgd/commit/4770e2b2d50c71e60cb073f6bc2e9bc82ec978f7 >
Closes GH-17351.
2025-01-04 14:53:18 +01:00
Christoph M. Becker
12ecdad183
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Port fix for libgd bug 276
2024-12-25 16:29:06 +01:00
Christoph M. Becker
643a77dda3
Port fix for libgd bug 276
...
The issue that BMP RLE occasionally swallowed some pixels[1] had been
fixed long ago in libgd, but apparently it has been overlooked to port
it to our bundled libgd.
We also introduce the test helper `test_image_equals_image()` which
compares in-memory images for equality.
[1] <https://github.com/libgd/libgd/issues/276 >
Closes GH-17250.
2024-12-25 16:27:20 +01:00
Niels Dossche
7b2b2ecab9
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Fix GH-16255: Unexpected nan value in ext/gd/libgd/gd_filter.c
2024-12-16 19:44:50 +01:00
Niels Dossche
6c198e380e
Fix GH-16255: Unexpected nan value in ext/gd/libgd/gd_filter.c
...
Closes GH-17169.
2024-12-16 19:43:44 +01:00
David Carlier
ec05cd559b
Merge branch 'PHP-8.3' into PHP-8.4
2024-11-13 12:49:13 +00:00
David Carlier
6f1d8368d8
Merge branch 'PHP-8.2' into PHP-8.3
2024-11-13 12:49:00 +00:00
David Carlier
4124b04e34
Fix GH-16771: imagecreatefromstring overflow on invalid format.
...
close GH-16776
2024-11-13 12:48:37 +00:00
Niels Dossche
d7e7e2b338
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Fix GH-16559: UBSan abort in ext/gd/libgd/gd_interpolation.c:1007
2024-10-23 20:10:04 +02:00
Niels Dossche
6d6afd9a83
Merge branch 'PHP-8.2' into PHP-8.3
...
* PHP-8.2:
Fix GH-16559: UBSan abort in ext/gd/libgd/gd_interpolation.c:1007
2024-10-23 20:09:39 +02:00
Niels Dossche
e1e1e64a32
Fix GH-16559: UBSan abort in ext/gd/libgd/gd_interpolation.c:1007
...
The `uchar_clamp` function was backported from old code, this backports
it from new code.
Closes GH-16562.
2024-10-23 20:09:12 +02:00
David Carlier
be370edbd7
Merge branch 'PHP-8.3' into PHP-8.4
2024-10-11 19:38:39 +01:00
David Carlier
d612b0a124
Merge branch 'PHP-8.2' into PHP-8.3
2024-10-11 19:38:26 +01:00
David Carlier
f2859a4050
Fix GH-16322: imageaffine overflow on affine argument.
...
close GH-16334
2024-10-11 19:37:34 +01:00
David Carlier
7f1fd0646b
Merge branch 'PHP-8.3' into PHP-8.4
2024-10-07 13:05:41 +01:00
David Carlier
7c43f68c98
Merge branch 'PHP-8.2' into PHP-8.3
2024-10-07 13:05:32 +01:00
David Carlier
a2bdfeff4f
Fix GH-16257 imagescale underflow on RGB channels.
...
backport of https://github.com/libgd/libgd/commit/948bb0a5c2010a24227e4b44a90e8b8aa9bda8ce
close GH-16257
2024-10-07 13:05:05 +01:00
David Carlier
3caa5f8592
Merge branch 'PHP-8.3' into PHP-8.4
2024-10-06 11:02:12 +01:00
David Carlier
fde5e507f6
Merge branch 'PHP-8.2' into PHP-8.3
2024-10-06 11:01:57 +01:00
David Carlier
2d05da2e94
Fix GH-16260: overflow/underflow on imagerotate degrees argument.
...
close GH-16264
2024-10-06 11:01:17 +01:00
David Carlier
215c61f9c7
Merge branch 'PHP-8.3' into PHP-8.4
2024-10-05 11:34:59 +01:00
David Carlier
8ff179529a
Merge branch 'PHP-8.2' into PHP-8.3
2024-10-05 11:34:49 +01:00
David Carlier
54973c9366
Fix GH-16232: bitshift overflow on wbmp file content reading.
...
backport from https://github.com/libgd/libgd/commit/a8f1d5cab0cad2bca2ed88a49c3f3de8585ff19b
close GH-16239
2024-10-05 11:34:31 +01:00
Gina Peter Bnayard
5853cdb73d
Use "must not" instead of "cannot" wording
2024-08-21 21:12:17 +01:00
Christoph M. Becker
6727f548b0
Port "gd2: use existing overflow2() rather than ad-hoc version" ( #15090 )
...
We port this modification[1] from libgd into our bundled libgd, because
the change makes sense, and we want the code bases to stay in sync as
close as possible.
We also apply a quick fix to the respective test.
[1] <https://github.com/libgd/libgd/commit/f0a059be6c36a0b2fce42b3c195d2d87f3d3420d >
2024-07-24 14:18:36 +02:00
Christoph M. Becker
82fe4a2d48
Merge branch 'PHP-8.3'
...
* PHP-8.3:
Fix skip condition of gh13082.phpt
2024-07-14 13:40:38 +02:00
Christoph M. Becker
02a60be24d
Fix skip condition of gh13082.phpt
...
The test failure is not particularly related to Travis, but rather is
caused by the GD font file to only be suitable for platforms where
`int` stores 32bit values in little endian byte order. This platform
dependence is documented in the source code[1]. Thus we fix the skip
condition and skip reason accordingly.
An alternative would be to dynamically create the font file just before
running the test, but that appears to be overkill.
[1] <https://github.com/php/php-src/blob/d59691c02fa77b65855ebbcd5f50aaac034ab75d/ext/gd/gd.c#L545-L556 >
Closes GH-14922.
2024-07-14 13:39:49 +02:00
Christoph M. Becker
a6d1844446
Merge branch 'PHP-8.3'
...
* PHP-8.3:
Add test case for GH-13774
2024-07-14 12:48:22 +02:00
Christoph M. Becker
6d0db52896
Add test case for GH-13774
...
Besides demonstrating the new behavior, this test also ensures that the
bundled and external libgd now behave the same. It has to be noted,
though, that we only test one of the five code paths.
Closes GH-14945.
2024-07-14 12:46:37 +02:00
Niels Dossche
71defce4be
Merge branch 'PHP-8.3'
...
* PHP-8.3:
ext/gd/tests/gh10614.phpt: skip if no PNG support
2024-07-10 19:51:17 +02:00
Michael Orlitzky
09957ab9a8
ext/gd/tests/gh10614.phpt: skip if no PNG support
...
This test uses imagecreatefrompng(), which won't be there if libgd was
built without PNG support.
Closes GH-14905.
2024-07-10 19:50:48 +02:00
David Carlier
23a55babb4
ext/gd: checking imagescale/imagefilter invalid values.
...
close GH-14598
2024-07-08 16:59:40 +01:00
David CARLIER
1fc083e526
ext/gd: iamgeresolution checks overflow. ( #14585 )
2024-06-16 23:28:04 +01:00
David Carlier
7b2ca071c5
ext/gd: imagewebp/imageavif/imagepng/imagejpeg stricter checks quality/speed.
...
close GH-14485
2024-06-05 23:07:57 +01:00
Giovanni Giacobbi
da769be7c9
Fix parameter numbers for imagecolorset()
...
This is the 8.2 & 8.3 version of GH-14477.
2024-06-05 18:01:59 +02:00
Giovanni Giacobbi
44cbdb107e
Fix parameter numbers and missing alpha check for imagecolorset()
...
The check for the alpha parameter existed in PHP 7.4 but was lost in PHP 8.0.
Fixes: 50765075db
Closes GH-14477.
2024-06-05 17:54:42 +02:00
Niels Dossche
b06fedb41d
Merge branch 'PHP-8.3'
...
* PHP-8.3:
Fix GH-10614: imagerotate will turn the picture all black, when rotated 90
2024-01-26 18:16:29 +01:00
Niels Dossche
f26dd1354b
Fix GH-10614: imagerotate will turn the picture all black, when rotated 90
...
This is a backport of the upstream libgd PR that was recently committed
[1].
[1] https://github.com/libgd/libgd/pull/862
Closes GH-13246.
2024-01-26 18:15:52 +01:00