Commit graph

693 commits

Author SHA1 Message Date
Christoph M. Becker
8c781c1c20 Resolve imagecropauto() default $mode quirk
The `$mode` parameter of `imagecropauto()` defaults to `-1`.  However,
`-1` is changed to `GD_CROP_DEFAULT` right away, so basically the
default is `GD_CROP_DEFAULT`, which is rather confusing and
unnecessary.

Therefore, we change the default to `IMG_CROP_DEFAULT`, but still allow
an explicit `-1` to be passed for BC reasons, in which case we trigger
a deprecation notice, so we can rid the `-1` support eventually.
2018-12-12 17:25:37 +01:00
Anatol Belski
9d7c510893 Cleanup unused items 2018-08-02 18:28:56 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Christoph M. Becker
3cbf594dfd Deprecate image2wbmp()
According to https://wiki.php.net/rfc/image2wbmp, we deprecate
`image2wbmp()`, rename the `$threshold` parameter to `$foreground`, and
remove superfluous code.
2018-06-10 00:33:42 +02:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Christoph M. Becker
027dd86107 Dump obsolete EBCDIC support
As already suggested by Thies this code won't compile anymore, because
php3_rqst has been removed in 1999[1].  Since apparently nobody
complained about that, we assume that EBCDIC support isn't required
here, and rid the respective code.

Furthermore, the code appears to be erroneous anyway, since at least
XBM isn't a binary file format.

[1] <3cd0af11ee (diff-1a9cfc6173e3a434387996e46086da56L258)>
2018-05-14 23:26:43 +02:00
Christoph M. Becker
4095f63a90 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #73957: signed integer conversion in imagescale()
2018-03-10 00:26:25 +01:00
Christoph M. Becker
d709922979 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #73957: signed integer conversion in imagescale()
2018-03-10 00:25:11 +01:00
Christoph M. Becker
f1b358c9a9 Fix #73957: signed integer conversion in imagescale()
We must not pass values to `gdImageScale()` which cannot be represented
by an `unsigned int`.  Instead we return FALSE, according to what we
already did for negative integers.
2018-03-10 00:17:09 +01:00
Gabriel Caruso
5f54f48024 [ci skip] Remove space between function name and open parentheses 2018-02-24 11:50:39 +01:00
Christoph M. Becker
3da9fc86d1 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix imagesetinterpolation arginfo
2018-02-24 11:33:13 +01:00
Christoph M. Becker
8c396e0e88 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix imagesetinterpolation arginfo
2018-02-24 11:32:03 +01:00
Gabriel Caruso
a358211a75 Fix imagesetinterpolation arginfo
imagesetinterpolation only requires one parameter.
2018-02-24 11:30:24 +01:00
Gabriel Caruso
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Christoph M. Becker
1530d01b7a Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix bug #75437 Wrong reflection on imagewebp
2017-10-25 13:10:33 +02:00
Christoph M. Becker
c78813a6b8 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #75437 Wrong reflection on imagewebp
2017-10-25 13:03:42 +02:00
Christoph M. Becker
9d59beb8ba Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #75437 Wrong reflection on imagewebp
2017-10-25 12:56:25 +02:00
Fabien Villepinte
0fbb9f343f Fix bug #75437 Wrong reflection on imagewebp 2017-10-25 12:54:05 +02:00
Xinchen Hui
ff6f41c94e Narrow typeinfos down for zend_parse_paramenters_none 2017-09-12 11:25:21 +08:00
Xinchen Hui
1f327284a4 Fixed signature 2017-09-09 20:40:55 +08:00
Tom Van Looy
da0b5b35c5 Remove redundant checks in ext/gd 2017-09-04 21:30:09 +02:00
Andreas Treichel
e4b9c3744c Replace magic values with constants 2017-08-19 14:28:22 +02:00
Andreas Treichel
47fcd13055 Add support for webp in imagecreatefromstring 2017-07-30 02:50:33 +02:00
Nikita Popov
b2a4af7b58 Merge branch 'PHP-7.1' 2017-02-02 18:15:11 +01:00
Nikita Popov
2d1955796e Merge branch 'PHP-7.0' into PHP-7.1 2017-02-02 18:14:50 +01:00
Matěj Humpál
acda2563ce Fix bug #74031
Fix incorrect parameter count for imagepng function
2017-02-02 18:13:53 +01:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Christoph M. Becker
500b496f8e Implement #69606: Support BMPs (added in GD 2.1.0)
We add PHP bindings for libgd's features to read and write BMP 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.
2017-01-04 14:55:02 +01:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Anatol Belski
bfb9be9bd4 Merge branch 'PHP-7.1'
* PHP-7.1:
  remove TSRMLS_*
2016-11-22 00:33:29 +01:00
Anatol Belski
d61db8d602 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  remove TSRMLS_*
2016-11-22 00:32:42 +01:00
Anatol Belski
5e9b4c26a5 remove TSRMLS_* 2016-11-21 23:53:37 +01:00
Christoph M. Becker
189bbb586c Merge branch 'pull-request/2164' 2016-11-13 23:31:40 +01:00
Joe Watkins
e0b6ac2976 Merge branch 'pull-request/2135' 2016-10-20 05:33:12 +01:00
Christoph M. Becker
209d4220d5 Add PHP bindings for setting and getting the image resolution
We expose the image resolution related GD functionality to userland
by introducing `imageresolution()` as getter/setter. Given only the
image argument, it returns the current resolution as indexed array.
Given only a second argument, it sets the horizontal and vertical
resolution to this value. Given three arguments, it sets the horizontal
and vertical resolution to the given arguments, respectively.
2016-10-18 01:53:39 +02:00
Christoph M. Becker
0f49aa3287 Merge branch 'pull-request/2151' 2016-10-17 10:37:38 +02:00
Christoph M. Becker
1aaa560d85 Mark functions as PHP_DEP_FE instead of manually emitting the notice 2016-10-15 23:41:33 +02:00
Christoph M. Becker
1490446ce0 RFC: Deprecate png2wbmp() and jpegwbmp()
See <https://wiki.php.net/rfc/deprecate-png-jpeg-2wbmp>.
2016-10-15 16:16:34 +02:00
Christoph M. Becker
c31eb5a407 Remove unused code
There is no gif2wbmp() or such, and it is highly unlikely that it'll be
ever added, so we remove the unused code.
2016-10-13 15:35:10 +02:00
Anatol Belski
fa45124138 fix syslog interference 2016-10-13 14:40:37 +02:00
Christoph M. Becker
7ce90014e2 Merge branch 'PHP-7.1' 2016-10-09 15:27:14 +02:00
Christoph M. Becker
a16f0c5e01 Merge branch 'PHP-7.0' into PHP-7.1 2016-10-09 15:21:40 +02:00
Christoph M. Becker
c930714cbe Merge branch 'PHP-5.6' into PHP-7.0 2016-10-09 15:14:17 +02:00
Christoph M. Becker
b92216b97d Fix #73272: imagescale() affects imagesetinterpolation()
We must not permanently change the interpolation method, but rather
have to restore the old method after we're done with scaling the image.
2016-10-09 15:10:34 +02:00
Christoph M. Becker
432e16cb58 Unify error handling of bundled and external libgd
There's no need anymore to call an own error handler directly. Instead we
register our error handler and call libgd's error functions (which will
forward). We do this regardless of compiling with the bundled or an external
libgd.
2016-10-07 01:13:49 +02:00