summaryrefslogtreecommitdiff
path: root/ext/gd/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-8.0'Nikita Popov2021-03-174-10/+10
|\ | | | | | | | | * PHP-8.0: Return bool from imageinterlace()
| * Return bool from imageinterlace()Nikita Popov2021-03-174-10/+10
| | | | | | | | | | | | | | 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.
* | 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.
* Don't throw from imagecreatefromstring() with too short stringNikita Popov2020-12-021-2/+3
| | | | | | | 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.
* Update ext/gd parameter namesNikita Popov2020-10-0926-32/+32
| | | | Closes GH-6308.
* 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.
* 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-071-5/+50
| | | | Closes GH-6075
* Promote warnings to exceptions in ext/gdMáté Kocsis2020-08-2032-54/+80
| | | | Closes GH-6023
* Add many missing closing PHP tags to testsMáté Kocsis2020-08-091-1/+0
| | | | Closes GH-5958
* Fix UNKNOWN default values in ext/mbstring and ext/gdMáté Kocsis2020-07-282-20/+3
| | | | Closes GH-5598
* 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
* Merge branch 'PHP-7.4'Christoph M. Becker2020-06-121-0/+31
|\ | | | | | | | | * PHP-7.4: Fix #79676: imagescale adds black border with IMG_BICUBIC
| * Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-06-121-0/+31
| |\ | | | | | | | | | | | | * 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-0/+31
| | | | | | | | | | | | | | | 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-221-0/+20
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79615: Wrong GIF header written in GD GIFEncode
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-05-221-0/+20
| |\ \ | | |/ | | | | | | | | | * 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-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Improve some ValueError messagesMáté Kocsis2020-04-0617-65/+65
| | | | | | | | | | | | Closes GH-5340
* | | 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-237-13/+13
| | | | | | | | | | | | 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
* | | Reindent phpt filesNikita Popov2020-02-0349-593/+593
| | |
* | | Fix #78880 Another roundMáté Kocsis2020-01-192-2/+2
| | |
* | | Make error messages more consistent by fixing capitalizationMáté Kocsis2020-01-1713-14/+14
| | | | | | | | | | | | Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
* | | Fix #78880: Final spelling fixesMáté Kocsis2020-01-163-3/+3
| | |
* | | Add imagegetinterpolation()Christoph M. Becker2020-01-143-6/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-01-062-0/+21
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79068: gdTransformAffineCopy() changes interpolation method
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-01-062-0/+21
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #79068: gdTransformAffineCopy() changes interpolation method
| | * Fix #79068: gdTransformAffineCopy() changes interpolation methodChristoph M. Becker2020-01-062-0/+21
| | | | | | | | | | | | | | | We port <https://github.com/libgd/libgd/commit/9088591eae437358ee5b929adf82865e37e3001e>.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-01-061-0/+14
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79067: gdTransformAffineCopy() may use unitialized values
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-01-061-0/+14
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #79067: gdTransformAffineCopy() may use unitialized values
| | * Fix #79067: gdTransformAffineCopy() may use unitialized valuesChristoph M. Becker2020-01-061-0/+14
| | | | | | | | | | | | | | | We port <https://github.com/libgd/libgd/commit/7a06c1669c563917bc48c464521e3de962ddb4e8>.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2019-12-072-3/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #78923: Artifacts when convoluting image with transparency
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-12-072-3/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #78923: Artifacts when convoluting image with transparency
| | * Fix #78923: Artifacts when convoluting image with transparencywillson-chen2019-12-072-3/+1
| | | | | | | | | | | | | | | | | | We have to properly initialize `pxl` before using it. Fix ported from <https://github.com/libgd/libgd/pull/559>.
* | | Make the $num_points parameter of php_imagepolygon optionalChristoph M. Becker2019-11-159-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That parameter is mostly useless in practise, and likely has been directly ported from the underlying `gdImagePolygon()` and friends, which require that parameter since the number of elements of the point array would otherwise be unknown. Typical usages of `imagepolygon()`, `imageopenpolygon()` and `imagefilledpolygon()` pass `count($points)/2` or hard-code this value as literal. Since explicitly specifying this parameter is annoying and error-prone, we offer the possibility to omit it, in which case the `$points` array must have an even number of elements, and the number of points is calculated as `count($points)/2`.
* | | Clean DONE tags from testsFabien Villepinte2019-11-0753-106/+0
| | | | | | | | | | | | | | | | | | | | | Remove most of the `===DONE===` tags and its variations. Keep `===DONE===` if the test output otherwise becomes empty. Closes GH-4872.
* | | Fix #55005: imagepolygon num_points requirementChristoph M. Becker2019-11-023-42/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We actually have to check `$num_points` instead of `2*count($points)`, because the latter may be greater than the former, but not all elements of `$points` are guaranteed to be used. This allowed to pass arrays with excess elements to draw polygons with less than three vertices. While the current implementation of `gdImagePolygon()` and friends would allow us to draw monogons and digons, we don't allow that anymore, because the respective drawing primitives work slightly different (e.g. drawing lines support anti-aliasing, but drawing general polygons does not). To minimize the BC break, we do not fix this longstanding issue for PHP 7, but target PHP 8 only.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2019-10-013-3/+3
|\ \ \ | |/ / | | | | | | | | | | | | | | | * PHP-7.4: Add missing skip keyword in tests Update NEWS for 7.4.0RC4 Update NEWS for PHP 7.4.0RC3
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-10-013-3/+3
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Add missing skip keyword in tests
| | * Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-10-013-3/+3
| | |\ | | | | | | | | | | | | | | | | * PHP-7.2: Add missing skip keyword in tests
| | | * Add missing skip keyword in testsFabien Villepinte2019-10-013-3/+3
| | | |
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-09-302-4/+3
|\ \ \ \ | |/ / /
| * | | Fix borked SKIPIFsFabien Villepinte2019-09-302-4/+3
| | | |
* | | | Convert GD Resources to objectsMark2019-09-3031-464/+86
| | | |
* | | | Prefer ValueError over Error in GDChristoph M. Becker2019-09-1014-41/+41
| | | | | | | | | | | | | | | | Cf. <https://github.com/php/php-src/pull/4682>.