summaryrefslogtreecommitdiff
path: root/ext/gd
Commit message (Collapse)AuthorAgeFilesLines
* Don't throw from imagecreatefromstring() with too short stringNikita Popov2020-12-022-4/+6
| | | | | | | If the string is too short, we should treat this the same way as an unrecognized image type. This function should be usable to determine whether something is a valid image without doing any checks beforehand.
* Don't allow properties on GdImageNikita Popov2020-10-221-1/+1
| | | | Just like all the other former resources... we missed this case.
* Fix null foreground in imagewbmpNikita Popov2020-10-141-1/+1
| | | | The variable was not actually passed to zpp...
* Update ext/gd parameter namesNikita Popov2020-10-0929-280/+276
| | | | Closes GH-6308.
* Add test instantiating all objectsNikita Popov2020-10-011-3/+3
| | | | | | Intended to find issues in opaque object destructors. Closes GH-6251.
* Throw warning for failed object to int/float conversionNikita Popov2020-09-211-3/+3
| | | | | | We previously couldn't increase the error level here because it was coupled to comparison handling. This is no longer the case in PHP 8.
* Consolidate the usage of "either" and "one of" in error messagesMáté Kocsis2020-09-201-1/+1
| | | | Closes GH-6173
* Run tidyNikita Popov2020-09-18116-321/+321
| | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* Make null byte error a ValueErrorNikita Popov2020-09-083-6/+6
| | | | | | | | | | | | | Currently we treat paths with null bytes as a TypeError, which is incorrect, and rather inconsistent, as we treat empty paths as ValueError. We do this because the error is generated by zpp and it's easier to always throw TypeError there. This changes the zpp implementation to throw a TypeError only if the type is actually wrong and throw ValueError for null bytes. The error message is also split accordingly, to be more precise. Closes GH-6094.
* Fix UNKNOWN default values in various extensionsMáté Kocsis2020-09-074-73/+76
| | | | Closes GH-6075
* Merge branch 'PHP-7.4' into masterChristoph M. Becker2020-08-241-4/+8
|\ | | | | | | | | * PHP-7.4: Fix potential integer overflow detected by oss-fuzz
| * 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>
* | | Promote warnings to exceptions in ext/gdMáté Kocsis2020-08-2033-69/+95
| | | | | | | | | | | | Closes GH-6023
* | | Add all the missing parameter types to stubsMáté Kocsis2020-08-132-6/+4
| | | | | | | | | | | | Closes GH-5955
* | | Add many missing closing PHP tags to testsMáté Kocsis2020-08-091-1/+0
| | | | | | | | | | | | Closes GH-5958
* | | Fix the default value handling of imagegif()Máté Kocsis2020-07-311-1/+1
| | |
* | | Add a few missing parameter types in stubsMáté Kocsis2020-07-302-5/+5
| | | | | | | | | | | | Related to GH-5627
* | | Fix UNKNOWN default values in ext/mbstring and ext/gdMáté Kocsis2020-07-285-112/+101
| | | | | | | | | | | | Closes GH-5598
* | | Explode _php_image_output_ctx() into multiple functionsMáté Kocsis2020-07-203-113/+199
| | | | | | | | | | | | Closes GH-5844
* | | Export php_gd_libgdimageptr_from_zval_p()Christoph M. Becker2020-07-113-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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()`.
* | | Review the usage of apostrophes in error messagesMáté Kocsis2020-07-101-10/+10
| | | | | | | | | | | | Closes GH-5590
* | | Drop dead prototypeNikita Popov2020-07-101-2/+0
| | |
* | | Remove proto comments from C filesMax Semenik2020-07-061-238/+119
| | | | | | | | | | | | Closes GH-5758
* | | Replace EXPECTF when possibleFabien Villepinte2020-06-294-4/+4
| | | | | | | | | | | | Closes GH-5779
* | | Remove unnecessary PHPDoc-alike blocks from testsMáté Kocsis2020-06-2411-61/+0
| | | | | | | | | | | | Closes GH-5759
* | | Include stub hash in generated arginfo filesNikita Popov2020-06-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hash is used to check whether the arginfo file needs to be regenerated. PHP-Parser will only be downloaded if this is actually necessary. This ensures that release artifacts will never try to regenerate stubs and thus fetch PHP-Parser, as long as you do not modify any files. Closes GH-5739.
* | | Return void from php_jpeg_emit_message()Nikita Popov2020-06-191-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | Instead of returning long and then casting to void. This fixes a build warning on Ubuntu 20.04. Closes GH-5742.
* | | Use ZEND_UNREACHABLE() instead of ZEND_ASSERT(0)Christoph M. Becker2020-06-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of marking unreachable code with `ZEND_ASSERT(0)`, we introduce `ZEND_UNREACHABLE()`, so that MSVC which does not consider `assert(0)` to mark unreachable code does no longer trigger C4715[1] warnings in debug builds. This may be useful for other compilers as well. [1] <https://docs.microsoft.com/de-de/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4715?view=vs-2019>
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-06-122-4/+35
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79676: imagescale adds black border with IMG_BICUBIC
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-06-122-4/+35
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #79676: imagescale adds black border with IMG_BICUBIC
| | * Fix #79676: imagescale adds black border with IMG_BICUBICChristoph M. Becker2020-06-122-4/+35
| | | | | | | | | | | | | | | 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.4'Christoph M. Becker2020-05-222-1/+21
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79615: Wrong GIF header written in GD GIFEncode
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-05-222-1/+21
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #79615: Wrong GIF header written in GD GIFEncode
| | * Fix #79615: Wrong GIF header written in GD GIFEncodeChristoph M. Becker2020-05-222-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Fix [-Wundef] warning in GD extensionGeorge Peter Banyard2020-05-204-20/+20
| | |
* | | Code tweaks: Remove unneeded semicolonsAlex Dowad2020-04-291-2/+2
| | |
* | | workaround typo in system libgd 2.3.0Remi Collet2020-04-151-0/+5
| | |
* | | Improve some TypeError and ValueError messagesMáté Kocsis2020-04-142-4/+4
| | | | | | | | | | | | Closes GH-5377
* | | Lowercase NULL to null in stubsMáté Kocsis2020-04-112-12/+12
| | |
* | | Store default parameter values of internal functions in arg infoMáté Kocsis2020-04-081-16/+19
| | | | | | | | | | | | | | | | | | | | | Closes GH-5353. From now on, PHP will have reflection information about default values of parameters of internal functions. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* | | Fix typo in GD stubNikita Popov2020-04-081-1/+1
| | |
* | | Improve some ValueError messagesMáté Kocsis2020-04-0618-137/+161
| | | | | | | | | | | | Closes GH-5340
* | | Generate functions entries from stubs for another set of extensionsMáté Kocsis2020-04-054-284/+286
| | | | | | | | | | | | Closes GH-5351
* | | Verify that all stubs have a return typeNikita Popov2020-04-032-2/+2
| | |
* | | Display nullability in type error messages for internal functionsMáté Kocsis2020-03-311-1/+1
| | | | | | | | | | | | Closes GH-5327
* | | Improve error messages of various extensionsMáté Kocsis2020-03-238-21/+21
| | | | | | | | | | | | Closes GH-5278
* | | Change argument error message formatMáté Kocsis2020-02-263-3/+3
| | | | | | | | | | | | Closes GH-5211
* | | Make type error messages more consistentMáté Kocsis2020-02-173-3/+3
| | | | | | | | | | | | Closes GH-5092
* | | Fix [-Wtype-limits] in bundled GD lib by using signed integersGeorge Peter Banyard2020-02-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As seen in the gdImageRotateBicubicFixed() function the same setup occurs but it uses signed integers, therefore we use also use signed integers in gdImageRotateBilinear() Moreover, these two functions have been removed upstream in https://github.com/libgd/libgd/commit/bd6d2e101f6f1df106d1cd2e2dc8058a5538109b therefore we should also mimic upstream and remove them... Thanks to @cmb69 for pointing it out.