Commit graph

848 commits

Author SHA1 Message Date
Niels Dossche
a3a318682a Merge branch 'PHP-8.3'
* PHP-8.3:
  Follow-up fix for GH-13082
2024-01-13 18:02:43 +01:00
Niels Dossche
7065fe3a88 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Follow-up fix for GH-13082
2024-01-13 18:02:25 +01:00
Niels Dossche
df85c2556e Follow-up fix for GH-13082
The font_obj should actually be NULL initialised, not the font gd
pointer.

Closes GH-13139.
2024-01-13 18:01:59 +01:00
David CARLIER
9726721560
general signatures discrepencies fixes (#13122) 2024-01-10 22:19:23 +00:00
David Carlier
7d238bf2d5 Merge branch 'PHP-8.2' into PHP-8.3 2024-01-09 22:01:15 +00:00
David Carlier
1e464e5b55 ext/gd: Fix GH-13082
Issue occur when compiling with recent clang releases (> 13) and
 with the '-Os' optimisation level, after using
`imageloadfont` which returns a proper GdFont class leads to
 a subtle bug when attempting to use via the imagefont* function.
2024-01-09 22:01:00 +00:00
David CARLIER
b0d8c10fd9 ext/gd: imagerotate removes ignore_transparent argument.
seems to be a relic of PHP 5 but no longer makes sense in regard of gdImageRotateInterpolated.

Close GH-11426
2023-06-19 12:32:08 +01:00
Máté Kocsis
101178214c
Declare proper parameter default values for imagegd2 (#10569) 2023-02-23 10:54:55 +01:00
Máté Kocsis
7936c8085e
Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
Niels
58d741c042
Remove unnecessary NULL-checks on ctx (#10256)
ctx can never be zero in these functions because they are dispatched
virtually by looking up their entries in ctx. Furthermore, 2 of these
checks never actually worked because ctx was dereferenced before ctx was
NULL-checked.
2023-01-08 12:09:20 +01:00
Stanislav Malyshev
f89284541c Merge branch 'PHP-8.2' 2022-10-23 18:49:34 -06:00
Stanislav Malyshev
dedaf40d21 Merge branch 'PHP-8.1' into PHP-8.2 2022-10-23 18:49:30 -06:00
Stanislav Malyshev
33e10cb1e0 Merge branch 'PHP-8.0' into PHP-8.1 2022-10-23 18:49:26 -06:00
Stanislav Malyshev
1d83a407d1 Merge branch 'PHP-7.4' into PHP-8.0 2022-10-23 18:49:21 -06:00
Christoph M. Becker
d50532be91 Fix #81739: OOB read due to insufficient validation in imageloadfont()
If we swap the byte order of the relevant header bytes, we need to make
sure again that the following multiplication does not overflow.
2022-10-23 18:41:48 -06:00
Bob Weinand
a01dd9feda Revert "Port all internally used classes to use default_object_handlers"
This reverts commit 94ee4f9834.

The commit was a bit too late to be included in PHP 8.2 RC1. Given it's a massive ABI break, we decide to postpone the change to PHP 8.3.
2022-09-14 11:13:23 +02:00
George Peter Banyard
1ad59b32c2 Update INI validator and displayers depending on INI type
Closes GH-9451
2022-09-06 10:33:34 +01:00
Bob Weinand
94ee4f9834 Port all internally used classes to use default_object_handlers
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-08-31 16:45:27 +02:00
Máté Kocsis
056e968c54
Declare ext/gd constants in stubs (#9180) 2022-07-30 15:18:06 +02:00
Christoph M. Becker
365537fd6d
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-8848: imagecopyresized() error refers to the wrong argument
2022-06-23 15:22:28 +02:00
Christoph M. Becker
bc8e52f651
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8848: imagecopyresized() error refers to the wrong argument
2022-06-23 15:22:09 +02:00
Christoph M. Becker
9405f43ba9
Fix GH-8848: imagecopyresized() error refers to the wrong argument
Closes GH-8849.
2022-06-23 15:20:49 +02:00
Remi Collet
baeba4b0d7
Merge branch 'PHP-8.1'
* PHP-8.1:
  add missing conditions
  fix [-Wstrict-prototypes] build warnings in ext/gd
2021-11-25 13:20:37 +01:00
Remi Collet
54f1f8cf2a
add missing conditions 2021-11-25 13:20:27 +01:00
Remi Collet
1241ec8c3f
fix [-Wstrict-prototypes] build warnings in ext/gd 2021-11-25 13:17:15 +01:00
Remi Collet
f566cba0bb
fix [-Wstrict-prototypes] build warnings in ext/gd 2021-11-25 13:17:07 +01:00
Remi Collet
7c0f2b4dc0
Merge branch 'PHP-8.1'
* PHP-8.1:
  add missing cond.
  Enable encoding detection for Polish text
2021-11-25 10:16:34 +01:00
Remi Collet
96a0ff73e9
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  add missing cond.
2021-11-25 10:16:17 +01:00
Remi Collet
f6621037a0
add missing cond. 2021-11-25 10:14:30 +01:00
Remi Collet
73d5dd77c4
Merge branch 'PHP-8.1'
* PHP-8.1:
  fix gdImagePngCtxEx call with system libgd
2021-11-25 08:27:48 +01:00
Remi Collet
80d63e9d17
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  fix gdImagePngCtxEx call with system libgd
2021-11-25 08:27:28 +01:00
Remi Collet
e713890d36
fix gdImagePngCtxEx call with system libgd 2021-11-25 08:27:07 +01:00
Dmitry Stogov
90b7bde615 Use more compact representation for packed arrays.
- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[i]
  instead of ht->arData[i]
- in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar
  familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes
  (ZEND_HASH_MAP_FOREACH_*)
- introduced an additional family of macros to access elements of array
  (packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX,
  ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT
- zend_hash_minmax() prototype was changed to compare only values

Because of smaller data set, this patch may show performance improvement
on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser)

TODO:
    - sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET).
    - zend_hash_sort_ex() may require converting packed arrays to hash.
2021-11-03 15:18:26 +03:00
Remi Collet
b3646440b1
Don't rely on libgd unused constants 2021-09-13 14:48:13 +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
Joe Watkins
570d9b63e9
Not serializable flag permeation 2021-07-20 12:28:35 +02:00
Christoph M. Becker
e1285c4aa5
Deprecate $num_points parameter of image(open|filled)polygon
Cf. <https://wiki.php.net/rfc/deprecations_php_8_1#num_points_parameter_of_image_open_filled_polygon>.

Co-authored-by: Máté Kocsis <kocsismate@woohoolabs.com>
Co-authored-by: George Peter Banyard <7906688+Girgias@users.noreply.github.com>

Closes GH-6789.
2021-07-14 10:56:24 +02:00
Ben Morss
cee33bab16
AVIF support for getimagesize() and imagecreatefromstring()
Thanks to Joe Drago for help with the AVIF detection code.

Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-7091.
2021-07-07 00:02:57 +02:00
Ben Morss
81f6d36c90 Add avif support to ext/gd
This backports avif support from upstream libgd into bundled libgd
and exposes the functionality through new imagecreatefromavif()
and imageavif() functions.

Closes GH-7026.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2021-06-10 12:32:30 +02:00
Christoph M. Becker
3f890635ae
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #81032: GD install is affected by external libgd installation
2021-05-14 12:28:36 +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
George Peter Banyard
c40231afbf
Mark various functions with void arguments.
This fixes a bunch of [-Wstrict-prototypes] warning,
because in C func() and func(void) have different semantics.
2021-05-12 14:55:53 +01:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
George Peter Banyard
a6fc427b8c Use zend_string_equals() API instead of strcmp() in various places
Closes GH-6784
2021-03-17 16:36:23 +00:00
Nikita Popov
db538775e1 Merge branch 'PHP-8.0'
* PHP-8.0:
  Return bool from imageinterlace()
2021-03-17 15:06:46 +01:00
Nikita Popov
c17434429d Return bool from imageinterlace()
The function accepts a bool since PHP 8.0, so it should also return
a bool to keep things consistent.

Furthermore a null return from this functions is not possible.
2021-03-17 15:05:09 +01:00
Nikita Popov
ce0bc58c22 Merge branch 'PHP-8.0'
* PHP-8.0:
  Mark resource-like objects as non-comparable
2021-02-16 14:22:03 +01:00
Nikita Popov
b63ea1047a Mark resource-like objects as non-comparable
As these hold on to some internal resource, there can't be two
"equal" objects with different identity. Make sure the lack of
public properties doesn't result in these being treated as always
equal.
2021-02-16 14:20:45 +01:00
Nikita Popov
550aee0be3 Merge branch 'PHP-8.0'
* PHP-8.0:
  Properly check imagegd() signature
  Make imagegd $file parameter nullable
2021-02-09 15:19:56 +01:00