Commit graph

28 commits

Author SHA1 Message Date
Máté Kocsis
17fa9b77bd
Fix the return type of imagecolorexactalpha() 2021-10-12 09:51:13 +02:00
Nikita Popov
cba166469d imagecolorsforindex() cannot return false 2021-08-26 16:36:27 +02:00
Christoph M. Becker
8bcaaa3579
Fix some imagecolor*() return types
These functions either return always a valid color, or `-1` on failure,
but never `false`.

Closes GH-7041.
2021-05-24 14:19:29 +02:00
Máté Kocsis
25e24715d7
Fix imagesetclip() parameter names
Closes GH-7035
2021-05-23 19:40:12 +02:00
Nikita Popov
d80118dc16 imagecolortransparent() cannot return null 2021-03-17 15:09:06 +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
838ae016d7 Make imagegd $file parameter nullable
It is explicitly documented to be nullable, and this matches other
functions like imagepng. It is also documented to accept a stream,
which it currently does not...
2021-02-09 15:15:20 +01:00
Nikita Popov
14a26db3e2 Update ext/gd parameter names
Closes GH-6308.
2020-10-09 17:10:11 +02:00
Máté Kocsis
628db3f3b5
Fix UNKNOWN default values in various extensions
Closes GH-6075
2020-09-07 19:02:02 +02:00
Máté Kocsis
2803c8fb8d
Add all the missing parameter types to stubs
Closes GH-5955
2020-08-13 14:47:18 +02:00
Máté Kocsis
0d330e1a02
Add a few missing parameter types in stubs
Related to GH-5627
2020-07-30 14:26:45 +02:00
Máté Kocsis
ac0da090ae
Fix UNKNOWN default values in ext/mbstring and ext/gd
Closes GH-5598
2020-07-28 17:06:25 +02:00
Máté Kocsis
19bf66a9e4
Explode _php_image_output_ctx() into multiple functions
Closes GH-5844
2020-07-20 23:25:02 +02:00
Máté Kocsis
7b2a8a6dda
Lowercase NULL to null in stubs 2020-04-11 14:13:11 +02:00
Nikita Popov
3ea94ed78e Fix typo in GD stub 2020-04-08 12:03:14 +02:00
Máté Kocsis
5322de1ba8
Generate functions entries from stubs for another set of extensions
Closes GH-5351
2020-04-05 00:59:44 +02:00
Nikita Popov
2bcc4ab8f4 Verify that all stubs have a return type 2020-04-03 17:59:30 +02: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
Máté Kocsis
d59bc80782
Fix smaller issues with stubs
GH-5025
2019-12-20 14:31:07 +01:00
Máté Kocsis
c58b12334d Add union return types with one class 2019-11-18 12:44:38 +01:00
Christoph M. Becker
2de79f0855 Make the $num_points parameter of php_imagepolygon optional
That parameter is mostly useless in practise, and likely has been
directly ported from the underlying `gdImagePolygon()` and friends,
which require that parameter since the number of elements of the point
array would otherwise be unknown.  Typical usages of `imagepolygon()`,
`imageopenpolygon()` and `imagefilledpolygon()` pass `count($points)/2`
or hard-code this value as literal.  Since explicitly specifying this
parameter is annoying and error-prone, we offer the possibility to omit
it, in which case the `$points` array must have an even number of
elements, and the number of points is calculated as `count($points)/2`.
2019-11-15 09:41:10 +01:00
Máté Kocsis
27e83d0fb8
Add union return types for function stubs 2019-11-11 14:54:55 +01:00
Mark
8aad466c42 Convert GD Resources to objects 2019-09-30 15:14:02 +02:00
Christoph M. Becker
0c5b75b063 Fix arginfo
The second parameter of `imagexbm()` is nullable.
2019-08-11 16:41:31 +02:00
Christoph M. Becker
f30501b172 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix parameter order
2019-08-11 16:18:44 +02:00
Christoph M. Becker
f273204011 Merge branch 'PHP-7.4'
* PHP-7.4:
  Extend color component range checks
2019-08-11 15:23:23 +02:00
Christoph M. Becker
4067519541 Fix arginfo 2019-08-11 13:54:52 +02:00
Christoph M. Becker
c90a27387e Add GD function stubs 2019-08-11 13:17:24 +02:00