summaryrefslogtreecommitdiff
path: root/ext/gd/libgd
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-08-241-4/+8
|\ | | | | | | | | * PHP-7.3: Fix potential integer overflow detected by oss-fuzz
| * Fix potential integer overflow detected by oss-fuzzChristoph M. Becker2020-08-241-4/+8
| | | | | | | | | | | | We port the respective fix from upstream[1]. [1] <https://github.com/libgd/libgd/commit/9ed642764cf0b4585d135eb738812a43265cb2d3>
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-06-121-4/+4
|\ \ | |/ | | | | | | * PHP-7.3: Fix #79676: imagescale adds black border with IMG_BICUBIC
| * Fix #79676: imagescale adds black border with IMG_BICUBICChristoph M. Becker2020-06-121-4/+4
| | | | | | | | | | We have to loop over all image pixels to avoid the black border. This is also done in external libgd in `_gdScaleOneAxis` and `_gdScalePass`.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-05-221-1/+1
|\ \ | |/ | | | | | | * PHP-7.3: Fix #79615: Wrong GIF header written in GD GIFEncode
| * Fix #79615: Wrong GIF header written in GD GIFEncodeChristoph M. Becker2020-05-221-1/+1
| | | | | | | | | | | | | | | | The color resolution is expected in bits 4-6 of the packed fields byte of the logical screen descriptor (byte 10 of the GIF data stream), according to the specification[1], section 18. [1] <https://www.w3.org/Graphics/GIF/spec-gif89a.txt>
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-01-061-1/+1
|\ \ | |/ | | | | | | * PHP-7.3: Fix #79068: gdTransformAffineCopy() changes interpolation method
| * Fix #79068: gdTransformAffineCopy() changes interpolation methodChristoph M. Becker2020-01-061-1/+1
| | | | | | | | | | We port <https://github.com/libgd/libgd/commit/9088591eae437358ee5b929adf82865e37e3001e>.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-01-062-3/+6
|\ \ | |/ | | | | | | * PHP-7.3: Fix #79067: gdTransformAffineCopy() may use unitialized values
| * Fix #79067: gdTransformAffineCopy() may use unitialized valuesChristoph M. Becker2020-01-062-3/+6
| | | | | | | | | | We port <https://github.com/libgd/libgd/commit/7a06c1669c563917bc48c464521e3de962ddb4e8>.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-12-071-0/+1
|\ \ | |/ | | | | | | * PHP-7.3: Fix #78923: Artifacts when convoluting image with transparency
| * Fix #78923: Artifacts when convoluting image with transparencywillson-chen2019-12-071-0/+1
| | | | | | | | | | | | We have to properly initialize `pxl` before using it. Fix ported from <https://github.com/libgd/libgd/pull/559>.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-11-211-1/+1
|\ \ | |/ | | | | | | * PHP-7.3: Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW
| * Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-11-211-1/+1
| |\ | | | | | | | | | | | | * PHP-7.2: Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW
| | * Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOWChristoph M. Becker2019-11-211-1/+1
| | | | | | | | | | | | | | | | | | Apparently, this has not been tested for a long time, and might be a refactoring relict. Anyhow, we have to pass the context to `GIFNextPixel` as well.
* | | Remove superfluous HAVE_GD_BUNDLED checksChristoph M. Becker2019-07-223-17/+4
| | | | | | | | | | | | | | | If we're compiling the bundled libgd, `HAVE_GD_BUNDLED` is set, so there is no need to check for this macro again.
* | | Use e.g. instead of less common f.e. [ci skip]Peter Kokot2019-07-091-1/+1
| | |
* | | Remove HAVE_ERRNO_H from libgdPeter Kokot2019-06-281-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | The check for errno.h has been removed via 50b9ef8d9435d23be40cea7fb484a02e99fdb617 Upstream libgd library is also patched via https://github.com/libgd/libgd/commit/1e7f93922fb3adf9f131d7e94aa13386062ffe11
* | | Support TGA readingChristoph M. Becker2019-06-203-0/+416
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Suppress shift UB in gd_itofx()Nikita Popov2019-06-191-2/+2
| | | | | | | | | | | | There doesn't seem to be a corresponding upstream fix for this.
* | | Fix buffer underflow in gd_gif_in.cNikita Popov2019-06-191-1/+1
| | | | | | | | | | | | | | | This has been fixed upstream in https://github.com/libgd/libgd/commit/939d49a3a9d1cbcd2a37cea9eac9f9e5e9f9de78.
* | | Fix shift UB in gd_io.cNikita Popov2019-06-191-2/+2
| | | | | | | | | | | | | | | | | | | | | This has already been fixed upstream in https://github.com/libgd/libgd/commit/24d352576c024769d18113a28f3be03d54fa1e66 and https://github.com/libgd/libgd/commit/772d0107a6b00a0d6d7191383fe984f8c018b48c.
* | | Remove unused _setEdgePixel() and getPixelOverflowColorTC() functionsNikita Popov2019-06-111-56/+0
| | |
* | | Fix fabs warning in gd_interpolation.cNikita Popov2019-06-111-2/+2
| | | | | | | | | | | | Matches upstream code.
* | | Remove safeboolean use in gd_jpeg.cNikita Popov2019-06-111-16/+3
| | | | | | | | | | | | | | | This is a backport of https://github.com/libgd/libgd/blob/e5502c7a3f1fe60536ec060f0211d97066c006ea/src/gd_jpeg.c.
* | | Fix abs(long) warnings in gd.cNikita Popov2019-06-111-1/+1
| | | | | | | | | | | | | | | I'm fixing this using (int) casts instead of labs() because this is what upstream GD does.
* | | Merge branch 'PHP-7.3' into PHP-7.4Stanislav Malyshev2019-05-271-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.3: Fix function name
| * | Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2019-05-271-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.2: Fix function name
| | * Fix function nameStanislav Malyshev2019-05-271-1/+1
| | |
* | | Merge branch 'PHP-7.3' into PHP-7.4Stanislav Malyshev2019-05-271-1/+5
|\ \ \ | |/ / | | | | | | | | | | | | | | | * PHP-7.3: Update NEWS Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow Fix #77973: Uninitialized read in gdImageCreateFromXbm
| * | Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2019-05-271-1/+5
| |\ \ | | |/ | | | | | | | | | | | | | | | * PHP-7.2: Update NEWS Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow Fix #77973: Uninitialized read in gdImageCreateFromXbm
| | * Merge branch 'PHP-7.1' into PHP-7.2Stanislav Malyshev2019-05-271-1/+5
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.1: Update NEWS Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow Fix #77973: Uninitialized read in gdImageCreateFromXbm
| | | * Fix #77973: Uninitialized read in gdImageCreateFromXbmChristoph M. Becker2019-05-271-1/+5
| | | | | | | | | | | | | | | | | | | | We have to ensure that `sscanf()` does indeed read a hex value here, and bail out otherwise.
* | | | [ci skip] Refactor libgd docsPeter Kokot2019-05-122-125/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes to simplify managing libgd docs a bit: - Move copyright statement and licensing info to common redistributable bins file. All previous notices left intact and updated with the upstream info. - Remove unsynced and difficult to track README file compared to upstream README.md file available at https://github.com/libgd/libgd
* | | | Implemented the gdScatter filter I wrote almost 10 years agoKalle Sommer Nielsen2019-05-102-0/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Fix uninit warning in gd.cNikita Popov2019-04-121-1/+1
| | | | | | | | | | | | | | | | This matches the upstream implementation.
* | | | Fix libgd warningsNikita Popov2019-04-113-3/+8
| | | |
* | | | Remove unused variablesFabien Villepinte2019-03-172-5/+3
| | | |
* | | | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-03-061-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: Fix #77700: Writing truecolor images as GIF ignores interlace flag
| * | | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-03-061-1/+1
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: Fix #77700: Writing truecolor images as GIF ignores interlace flag
| | * | Fix #77700: Writing truecolor images as GIF ignores interlace flagChristoph M. Becker2019-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We revert the interlace flag related part of commit ff2822a[1], since contrary to the transparent color, the interlace flag is not retained by `gdImageCreatePaletteFromTrueColor()`. This also matches upstream libgd. [1] <http://git.php.net/?p=php-src.git;a=commit;h=ff2822a82b740edb8ccf307f080bae188c200fb9>
* | | | Remove local variablesPeter Kokot2019-02-031-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Remove yearly range from copyright noticeZeev Suraski2019-01-301-1/+1
| | | |
* | | | Sync with upstreamChristoph M. Becker2019-01-193-9/+46
| | | | | | | | | | | | | | | | | | | | | | | | Even though libgd/libgd#492 is not a relevant bug fix for PHP, since the binding doesn't use the `gdImage*Ptr()` functions at all, we're porting the fix to stay in sync here.
* | | | Merge branch 'PHP-7.3'Christoph M. Becker2019-01-191-0/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: Fix #77479: imagewbmp() segfaults with very large images
| * | | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-01-191-0/+1
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: Fix #77479: imagewbmp() segfaults with very large images
| | * | Fix #77479: imagewbmp() segfaults with very large imagesChristoph M. Becker2019-01-191-0/+1
| | | | | | | | | | | | | | | | | | | | We must not proceed working with the Wbmp structure, if it hasn't been allocated.
* | | | Merge branch 'PHP-7.3'Christoph M. Becker2019-01-161-5/+23
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: Fix #73614: gdImageFilledArc() doesn't properly draw pies
| * | | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-01-161-5/+23
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: Fix #73614: gdImageFilledArc() doesn't properly draw pies
| | * | Fix #73614: gdImageFilledArc() doesn't properly draw piesChristoph M. Becker2019-01-161-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix for PHP bug 43828[1] changed the algorithm from drawing filled pies from drawing multiple triangles to drawing a single polygon. Due to quirks of the filled polygon drawing algorithm, we had to filter out extraneous vertices. This lead, however, to a bug regarding displaced starting and ending points near 90° and 270° degrees, which we fix by reinserting these vertices if they had been removed. This fix is a port of libgd/libgd@1406b1a. [1] <https://bugs.php.net/bug.php?id=43828>