Commit Graph

16 Commits

Author SHA1 Message Date
David Carlier
79c134a6e8
Merge branch 'PHP-8.3' 2024-07-13 17:00:53 +01:00
Denis Ryabov
b456ae8d34
Restore Warning instead of Fatal Error in gd_webp.c
According to the docs (https://www.php.net/manual/en/function.imagecreatefromwebp.php and https://www.php.net/manual/en/function.imagewebp.php), `false` should be returned on errors (similar to other functions of the `gd` extension), but actually all errors result in a `Fatal Error`. It doesn't look normal when trying to read an empty file or a file in the wrong format causes the program to stop. The problem seems to be related to a mega-patch that replaced `zend_error` with `zend_error_noreturn` almost everywhere. My patch fixes this behavior by switching from `zend_error_noerror` to `gd_error` (i.e. to `E_WARNING` level). All necessary memory cleanup is already in the code (as it was before the "zend_error_noreturn" patch).

Close GH-13774
2024-07-13 16:58:54 +01:00
Peter Kokot
c44834d8ad
Trim trailing whitespace (#14721) 2024-06-29 18:41:45 +02:00
Ilija Tovilo
692cea5cbc
Use zend_error_noreturn for E_ERROR consistently
To be clear, these already don't return. zend_error_noreturn just hints at this
fact through the ZEND_NORETURN attribute.

Closes GH-12204
2023-09-14 11:44:55 +02:00
Christoph M. Becker
b78c087b32
Fix typo (Paletter → Palette)
This also aligns the error message with upstream[1].

[1] <https://github.com/libgd/libgd/blob/gd-2.3.3/src/gd_webp.c#L182>

Closes GH-9414.
2022-08-24 13:40:16 +02:00
Ben Morss
eb6c9eb936
Lossless conversion for webp
Propagating lossless conversion from libgd to our bundled gd.
Changing "quantization" to "quality" as in libgd.
Adding test.

IMG_WEBP_LOSSLESS is only defined, if lossless WebP encoding is
supported by the libgd used.

Closes GH-7348.
2021-08-12 23:19:13 +02:00
Nikita Popov
19d8a6b771 Migrate ext/gd to pkg-config
* --with-webp-dir becomes --with-webp
* --with-jpeg-dir becomes --with-jpeg
* --with-png-dir is removed. libpng is required.
* --with-zlib-dir is removed. zlib is required.
* --with-xpm-dir becomes --with-xpm.

We also enable --with-webp on Travis.
2019-01-15 10:15:05 +01:00
Gabriel Caruso
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01: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
Anatol Belski
f7e81fd9f1 fix double free and move temps into local scope 2016-03-07 16:38:47 +01:00
Anatol Belski
0fccddba75 add error check 2016-03-07 16:26:01 +01:00
Christoph M. Becker
00ba7e6215 Replaced libvpx by libwebp (first draft; Windows only)
ext/gd/libgd/gd_webp.c has been taken from libgd[1]. Mainly, gd_error(X) has
been subsituted by zend_error(E_ERROR, X) and BGD_DECLARE(X) by X. Further
modifications are obvious from the diff.

All GD tests are passing, what raises hope, but we need more WebP tests,
anyway.

[1] <7ec030c4f1/src/gd_webp.c>
2015-07-21 10:37:06 +02:00
Remi Collet
b4632d0c12 Upstream fix from https://bitbucket.org/libgd/gd-libgd/issue/75 2013-06-24 11:03:12 +02:00
Ilia Alshanetsky
7b2a2eb326 Removed debug code 2010-10-05 12:27:00 +00:00
Pierre Joye
12f855b3be - missing file for webp 2010-10-04 22:34:02 +00:00