summaryrefslogtreecommitdiff
path: root/ext/gd
Commit message (Collapse)AuthorAgeFilesLines
* Use zend_string_equals() API instead of strcmp() in various placesGeorge Peter Banyard2021-03-171-1/+1
| | | | Closes GH-6784
* Merge branch 'PHP-8.0'Nikita Popov2021-03-172-3/+3
|\ | | | | | | | | * PHP-8.0: imagecolortransparent() cannot return null
| * imagecolortransparent() cannot return nullNikita Popov2021-03-172-3/+3
| |
* | Merge branch 'PHP-8.0'Nikita Popov2021-03-177-14/+14
|\ \ | |/ | | | | | | * PHP-8.0: Return bool from imageinterlace()
| * Return bool from imageinterlace()Nikita Popov2021-03-177-14/+14
| | | | | | | | | | | | | | The function accepts a bool since PHP 8.0, so it should also return a bool to keep things consistent. Furthermore a null return from this functions is not possible.
* | Merge branch 'PHP-8.0'Nikita Popov2021-02-161-0/+1
|\ \ | |/ | | | | | | * PHP-8.0: Mark resource-like objects as non-comparable
| * Mark resource-like objects as non-comparableNikita Popov2021-02-161-0/+1
| | | | | | | | | | | | | | As these hold on to some internal resource, there can't be two "equal" objects with different identity. Make sure the lack of public properties doesn't result in these being treated as always equal.
* | Improve class entry generationMáté Kocsis2021-02-161-3/+2
| | | | | | | | Related to GH-6701
* | Deprecate passing null to non-nullable arg of internal functionNikita Popov2021-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This deprecates passing null to non-nullable scale arguments of internal functions, with the eventual goal of making the behavior consistent with userland functions, where null is never accepted for non-nullable arguments. This change is expected to cause quite a lot of fallout. In most cases, calling code should be adjusted to avoid passing null. In some cases, PHP should be adjusted to make some function arguments nullable. I have already fixed a number of functions before landing this, but feel free to file a bug if you encounter a function that doesn't accept null, but probably should. (The rule of thumb for this to be applicable is that the function must have special behavior for 0 or "", which is distinct from the natural behavior of the parameter.) RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg Closes GH-6475.
* | Merge branch 'PHP-8.0'Nikita Popov2021-02-093-19/+25
|\ \ | |/ | | | | | | | | * PHP-8.0: Properly check imagegd() signature Make imagegd $file parameter nullable
| * Properly check imagegd() signatureNikita Popov2021-02-091-2/+12
| | | | | | | | | | Unlike imagegd2(), this function only accepts two parameters, so we should be checking for that.
| * Make imagegd $file parameter nullableNikita Popov2021-02-093-18/+14
| | | | | | | | | | | | It is explicitly documented to be nullable, and this matches other functions like imagepng. It is also documented to accept a stream, which it currently does not...
* | Implicitly enable function entry generation when class entry generation is ↵Máté Kocsis2021-02-092-5/+2
| | | | | | | | | | | | enabled Closes GH-6675
* | Generate class entries from stubs for another batch of extensionsMáté Kocsis2021-02-083-10/+32
| | | | | | | | Closes GH-6669
* | Replace zend_bool uses with boolNikita Popov2021-01-151-14/+14
| | | | | | | | | | | | | | We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
* | Merge branch 'PHP-8.0'Nikita Popov2020-12-022-4/+6
|\ \ | |/ | | | | | | * PHP-8.0: Don't throw from imagecreatefromstring() with too short string
| * 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.
* | Fix zpp for GdFont|intNikita Popov2020-10-221-20/+22
| | | | | | | | Use Z_PARAM_OBJ_OF_TYPE_OR_LONG to get standard behavior.
* | Don't allow properties on former resource objectsNikita Popov2020-10-221-2/+2
| |
* | Merge branch 'PHP-8.0'Nikita Popov2020-10-221-1/+1
|\ \ | |/ | | | | | | * PHP-8.0: Don't allow properties on GdImage
| * Don't allow properties on GdImageNikita Popov2020-10-221-1/+1
| | | | | | | | Just like all the other former resources... we missed this case.
* | Convert gdFont from resource to objectSara Golemon2020-10-213-81/+117
| |
* | Remove IGNORE_URL_WIN macroChristoph M. Becker2020-10-181-4/+4
|/ | | | | | | | This macro is defined to zero as of PHP 5.0.0, and as the comment indicates, is no longer relevant. Thus, we remove the definition and all usages from the core and bundled extensions. Closes GH-6351.
* 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>