Commit Graph

139 Commits

Author SHA1 Message Date
Máté Kocsis
056e968c54
Declare ext/gd constants in stubs (#9180) 2022-07-30 15:18:06 +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
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
Christoph M. Becker
340e2ead77 Export php_gd_libgdimageptr_from_zval_p()
Some extension may need to retrieve the `gdImagePtr` from an `GdImage`
object; thus, we export the respective function.  To not being forced
to include gd.h in php_gd.h, we use the opaque `struct gdImageStruct *`
as return type.

We also rename php_gd2.dll to php_gd.dll, since there's not really much
point in giving the DLL a version number, since there is no php_gd.dll
for years (if there ever has been).  Renaming, on the other hand,
matches the name on other systems (gd.so), and allows to actually use
`ADD_EXTENSION_DEP()`.
2020-07-11 19:33:20 +02:00
Nikita Popov
c1e792e1aa Drop dead prototype 2020-07-10 10:23:19 +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
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
Christoph M. Becker
88bab00199 Remove unused code
These are left-overs from image2wbmp(), which has already been removed.
2019-11-02 00:10:46 +01:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Remi Collet
92d6720dcf Merge branch 'PHP-7.4'
* PHP-7.4:
  cleanup gd build with system libgd - drop need to use libpng with system libgd - drop need to use libjpeg with system libgd - drop need to use libXpm with system libgd - drop need to use libfreetype with system libgd - improve configure comments
2019-07-22 16:14:36 +02:00
Remi Collet
31d85b8417 cleanup gd build with system libgd - drop need to use libpng with system libgd - drop need to use libjpeg with system libgd - drop need to use libXpm with system libgd - drop need to use libfreetype with system libgd - improve configure comments 2019-07-22 16:14:19 +02:00
Christoph M. Becker
ebe91a0066 Merge branch 'PHP-7.4'
* PHP-7.4:
  Drop superfluous ENABLE_GD_TTF
2019-07-22 12:01:58 +02:00
Christoph M. Becker
d3d3404db7 Drop superfluous ENABLE_GD_TTF
If we `HAVE_LIBFREETYPE`, we define `ENABLE_GD_TTF` if it is not
defined.  Therefore we can check for `HAVE_LIBFREETYPE` in the first
place.
2019-07-22 12:01:24 +02:00
Christoph M. Becker
611c57eaf7 Merge branch 'PHP-7.4'
* PHP-7.4:
  Properly shut down font cache mutex
2019-06-21 16:01:28 +02:00
Christoph M. Becker
eec5d2a25f Properly shut down font cache mutex
Since the font cache mutex in set up in MINIT, we have to shut it down
in MSHUTDOWN.
2019-06-21 16:00:47 +02:00
Christoph M. Becker
7469d572f2 Merge branch 'PHP-7.4'
* PHP-7.4:
  Support TGA reading
2019-06-20 23:41:23 +02:00
Christoph M. Becker
81fd113506 Support TGA reading
We add PHP bindings for libgd's features to read TGA 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.

Since TGA has no easily recognizable file signature, we don't add TGA
support for imagecreatefromstring() or getimagesize() and friends.
2019-06-20 23:40:51 +02:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Zeev Suraski
38c337f22e Remove year range from copyright notice 2019-01-30 11:00:23 +02:00
Christoph M. Becker
e973663882 Remove deprecated png2wbmp() and jpeg2wbmp()
Cf. <https://wiki.php.net/rfc/deprecate-png-jpeg-2wbmp>
2019-01-28 14:50:52 +01:00
Christoph M. Becker
dfa6c2046a Remove deprecated image2wbmp()
Cf. <https://wiki.php.net/rfc/image2wbmp>.
2019-01-28 14:29:06 +01: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
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08: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
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
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
2a305b38b7 Implement request #33066: Add GD Image Function gdImageOpenPolygon()
gdImageOpenPolygon() has been introduced with líbgd 2.0.29, so we finally
add a PHP binding for it, and port the respective libgd functionality to
PHP's bundled libgd.
2016-10-02 20:27:58 +02:00
Christoph M. Becker
d0f14a4429 Switch to libgd anti-aliased drawing API
Instead of rolling our own in the bundled libgd, we use libgd's anti-aliased
drawing API. This way imageantialias() is also available, when built against
a system libgd.
2016-10-02 13:16:40 +02:00
Christoph M. Becker
d795a6bf97 Implement #52857: Access to gdImageSetClip() and gdImageGetClip()
We add the necessary PHP bindings for both functions which are available
as of GD_2_0_12 (released 2006-04-05). The API of imagegetclip() is modelled
according to imageftbbox().
2016-07-23 16:14:36 +02:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Kalle Sommer Nielsen
cff872eaad Remove the references to imageps*() after the T1Lib removal (Noticed by Ferenc) 2015-06-19 14:55:10 +02:00
Kalle Sommer Nielsen
7dcfdbbee4 Remove T1Lib support (see #69698)
# Also removes imagepscopyfont() which was never available (commented out)
2015-05-29 09:18:36 +02:00
Anatol Belski
2d78023244 cleanup the mod version macros, round 2 2015-03-23 20:33:54 +01:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Felipe Pena
0d6247f968 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  - Fix extern declaration according to definition
2013-10-20 01:16:10 -02:00
Felipe Pena
a1daebefda - Fix extern declaration according to definition 2013-10-20 01:16:07 -02:00
Remi Collet
00b097d2a3 fix build with bundled libgd 2013-05-04 16:51:56 +02:00
Ondřej Surý
8a90aad35b Required GD >= 2.1.0 or GD bundled, this allows us to remove most of the #ifdef 2013-05-04 16:50:06 +02:00
Ondřej Surý
6aedadce0a Allow to use new GD-2.1.0 function from system library 2013-05-04 16:49:35 +02:00
Remi Collet
26bd2cba81 gd: missing headers in previous 2013-04-24 16:15:42 +02:00
Pierre Joye
1ec484d3c5 - add imageaffinematrixget and imagematrixconcat 2013-03-20 12:19:03 +01:00