History log of /PHP-7.4/ext/gd/gd.c (Results 1 – 25 of 626)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# d50532be 18-Oct-2022 Christoph M. Becker

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 multiplicatio

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.

show more ...


# 28e7addb 12-May-2021 Flavio Heleno

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

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.

show more ...


# 92c23e1f 09-Dec-2019 Dmitry Stogov

Call zend_unregister_ini_entries() when unload extension loaded through dl() without MSHUTDOWN callback.
Extensions with MSHUTDOWN should use UNREGISTER_INI_ENTRIES().


Revision tags: php-7.3.13RC1, php-7.2.26RC1, php-7.4.0, php-7.2.25, php-7.3.12, php-7.4.0RC6, php-7.3.12RC1, php-7.2.25RC1, php-7.4.0RC5, php-7.1.33, php-7.2.24, php-7.3.11, php-7.4.0RC4, php-7.3.11RC1, php-7.2.24RC1, php-7.4.0RC3, php-7.2.23, php-7.3.10, php-7.4.0RC2, php-7.2.23RC1, php-7.3.10RC1, php-7.4.0RC1, php-7.1.32, php-7.2.22, php-7.3.9, php-7.4.0beta4, php-7.2.22RC1, php-7.3.9RC1
# 9818f863 11-Aug-2019 Christoph M. Becker

Fix parameter order

`imagecopymerge()` and `imagecopymergegray()` expect the destination
image first, not the other way round.


# 092571c1 11-Aug-2019 Christoph M. Becker

Extend color component range checks

We also check for alpha components to be within range, and we add yet
missing range checks for other functions as well.


Revision tags: php-7.4.0beta2, php-7.1.31, php-7.2.21, php-7.3.8, php-7.4.0beta1
# d59aac58 18-Jul-2019 Nikita Popov

Report errors from stream read and write operations

The php_stream_read() and php_stream_write() functions now return
an ssize_t value, with negative results indicating failure. Function

Report errors from stream read and write operations

The php_stream_read() and php_stream_write() functions now return
an ssize_t value, with negative results indicating failure. Functions
like fread() and fwrite() will return false in that case.

As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams
should not be regarded as error conditions, and be reported as
successful zero-length reads/writes instead. The handling of EINTR
remains unclear and is internally inconsistent (e.g. some code-paths
will automatically retry on EINTR, while some won't).

I'm landing this now to make sure the stream wrapper ops API changes
make it into 7.4 -- however, if the user-facing changes turn out to
be problematic we have the option of clamping negative returns to
zero in php_stream_read() and php_stream_write() to restore the
old behavior in a relatively non-intrusive manner.

show more ...


# 31d85b84 22-Jul-2019 Remi Collet

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

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

show more ...


# d3d3404d 21-Jul-2019 Christoph M. Becker

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.


# 290e520c 16-Jul-2019 Nikita Popov

Use ZEND_HASH_FOREACH APIs in a few more places


Revision tags: php-7.2.21RC1, php-7.3.8RC1, php-7.4.0alpha3, php-7.3.7, php-7.2.20, php-7.4.0alpha2
# eec5d2a2 21-Jun-2019 Christoph M. Becker

Properly shut down font cache mutex

Since the font cache mutex in set up in MINIT, we have to shut it down
in MSHUTDOWN.


# 81fd1135 20-Jun-2019 Christoph M. Becker

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

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.

show more ...


Revision tags: php-7.3.7RC3
# 4488475a 20-Jun-2019 Nikita Popov

imagecolorallocate(): Check that RGB components are in-range

Instead of letting them bleed over into other components.


# 88b60376 19-Jun-2019 Nikita Popov

imageloadfont: Perform overflow check before calculation

Instead of afterwards...


Revision tags: php-7.3.7RC2, php-7.2.20RC2
# 3c5bb065 13-Jun-2019 Christoph M. Becker

Add BMP support to PHP info


Revision tags: php-7.4.0alpha1, php-7.3.7RC1, php-7.2.20RC1, php-7.2.19, php-7.3.6, php-7.1.30, php-7.2.19RC1, php-7.3.6RC1, php-7.1.29, php-7.2.18, php-7.3.5, php-7.2.18RC1, php-7.3.5RC1, php-7.2.17, php-7.3.4, php-7.1.28, php-7.3.4RC1, php-7.2.17RC1, php-7.1.27, php-7.3.3, php-7.2.16
# a31f4642 26-Feb-2019 Nikita Popov

Allow exceptions in __toString()

RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error excep

Allow exceptions in __toString()

RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.

show more ...


# bcd11a1d 09-May-2019 Kalle Sommer Nielsen

Implemented the gdScatter filter I wrote almost 10 years ago

This filter is available as of libgd 2.1.0 which is our bare minimum for
external compilation of ext/gd.

The scatter

Implemented the gdScatter filter I wrote almost 10 years ago

This filter is available as of libgd 2.1.0 which is our bare minimum for
external compilation of ext/gd.

The scatter filter works by iterating over all pixels in the image and
shifting them randomly based on two modifier (`plus` and `sub`) values:

dest_x = (int)(x + ((rand() % (plus - sub)) + sub));
dest_y = (int)(y + ((rand() % (plus - sub)) + sub));

Additionally the scatter filter also supports by only shifting pixels where
the current pixel being iterated is one or more colors, allowing the scatter
filter to only effect solid colors in part of an image.

Note, due to the nature of randomness and implementation, pixels who were
shifted ahead of iteration will be shifted once more and therefore the
bottom right of an image may contain a slight scatter effect due to this.

show more ...


# 18a9ae41 29-Apr-2019 Christoph M. Becker

Fix #77943: imageantialias($image, false); does not work

Firstly, we must not call `gdImageSetAntiAliased()` (which sets the
color to anti-alias), but rather modify the `gdImage.AA` flag

Fix #77943: imageantialias($image, false); does not work

Firstly, we must not call `gdImageSetAntiAliased()` (which sets the
color to anti-alias), but rather modify the `gdImage.AA` flag.
Furthermore, we have to actually use the supplied boolean value.

We also make sure that we don't attempt to enable anti-aliasing for
palette images.

show more ...


# cd94cf60 29-Apr-2019 Christoph M. Becker

Fix #77943: imageantialias($image, false); does not work

Firstly, we must not call `gdImageSetAntiAliased()` (which sets the
color to anti-alias), but rather modify the `gdImage.AA` flag

Fix #77943: imageantialias($image, false); does not work

Firstly, we must not call `gdImageSetAntiAliased()` (which sets the
color to anti-alias), but rather modify the `gdImage.AA` flag.
Furthermore, we have to actually use the supplied boolean value.

We also make sure that we don't attempt to enable anti-aliasing for
palette images.

show more ...


# b6f9ade9 08-Mar-2019 Fabien Villepinte

Remove unused variables


# 345a75f5 28-Feb-2019 Christoph M. Becker

Remove dead code

`_php_image_output()` is only ever called for `PHP_GDIMG_CONVERT_WBM`,
`PHP_GDIMG_TYPE_GD` and `PHP_GDIMG_TYPE_GD2`. All other image types
solely use the more flexi

Remove dead code

`_php_image_output()` is only ever called for `PHP_GDIMG_CONVERT_WBM`,
`PHP_GDIMG_TYPE_GD` and `PHP_GDIMG_TYPE_GD2`. All other image types
solely use the more flexible `_php_image_output_ctx()`.

show more ...


Revision tags: php-7.3.3RC1, php-7.2.16RC1, php-7.2.15, php-7.3.2, php-7.2.15RC1
# 92ac598a 22-Jan-2019 Peter Kokot

Remove local variables

This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly

Remove local variables

This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files. All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.

show more ...


# 0cf7de1c 30-Jan-2019 Zeev Suraski

Remove yearly range from copyright notice


Revision tags: php-7.3.2RC1, php-5.6.40, php-7.1.26, php-7.3.1, php-7.2.14
# 3c9af309 29-Dec-2018 Andreas Treichel

Preserve aspect ratio for width or height


Revision tags: php-7.2.14RC1, php-7.3.1RC1
# 8c781c1c 12-Dec-2018 Christoph M. Becker

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
d

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.

show more ...


Revision tags: php-5.6.39, php-7.1.25, php-7.2.13, php-7.0.33, php-7.3.0, php-7.1.25RC1, php-7.2.13RC1, php-7.3.0RC6, php-7.1.24, php-7.2.12, php-7.3.0RC5, php-7.1.24RC1, php-7.2.12RC1, php-7.3.0RC4
# 902d39a3 13-Oct-2018 Peter Kokot

Trim trailing whitespace in source code files


12345678910>>...26