Re: com php-src: Make tests a little more resilient:ext/gd/tests/bug22544.phpt ext/gd/tests/bug43828.phptext/gd/tests/bug72604.phpt
ext/gd/tests/imagearc_basic.phptext/gd/tests/imagearc_error1.phpt ext/gd/tests/imagearc_variation1.phptext/gd
| From: | Christoph M. Becker | Date: | Tue, 30 Aug 2016 22:44:00 +0000 |
| Subject: | Re: com php-src: Make tests a little more resilient:ext/gd/tests/bug22544.phpt ext/gd/tests/bug43828.phptext/gd/tests/bug72604.phpt ext/gd/tests/imagearc_basic.phptext/gd/tests/imagearc_error1.phpt ext/gd/tests/imagearc_variation1.phptext/gd |
||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-94175@lists.php.net to get a copy of this message | ||
On 30.08.2016 at 19:20, Christoph M. Becker wrote:
>
> On 30.08.2016 at 18:33, Anatol Belski wrote:
>>
>>> -----Original Message-----
>>> From: Christoph Michael Becker [mailto:cmb@php.net]
>>> Sent: Wednesday, August 17, 2016 6:00 PM
>>> To: php-cvs@lists.php.net
>>> Subject: [PHP-CVS] com php-src: Make tests a little more resilient:
>>> ext/gd/tests/bug22544.phpt ext/gd/tests/bug43828.phpt
>>> ext/gd/tests/bug72604.phpt ext/gd/tests/imagearc_basic.phpt
>>> ext/gd/tests/imagearc_error1.phpt ext/gd/tests/imagearc_variation1.phpt
>>> ext/gd/tes
>>>
>>> Commit: a3159d29bb24d5c946c14b7aa33e96bebcd56e59
>>> Author: Christoph M. Becker <cmbecker69@gmx.de> Wed, 17 Aug 2016
>>> 17:59:33 +0200
>>> Parents: 48198e4c257825ab89ee027bff5a93fc2cd59601
>>> Branches: PHP-5.6 PHP-7.0 PHP-7.1 master
>>>
>>> Link: http://git.php.net/?p=php-
>>> src.git;a=commitdiff;h=a3159d29bb24d5c946c14b7aa33e96bebcd56e59
>>>
>>> Log:
>>> Make tests a little more resilient
>>>
>>> PNG allows identical images to be stored differently what makes nearly all tests
>>> checking the MD5 hash of the PNG representation fail with external libgd. For
>>> now, we use the GD format instead, which doesn't allow for such differences.
>>>
>>> Of course, this md5() checking should be replaced by a image diffing feature in
>>> the long run.
>>
>> I've got these fails at least in 7.0 x64
>>
>> TEST 1/3
>> [C:\php-sdk\php70\vc14\x64\php-src\ext\gd\tests\imagecolorallocatealpha_basic.phpt]
>> ========DIFF========
>> 001+ string(32) "d776984f1a2ce89be189bd16db303427"
>> 001- string(32) "0981ef94ee2209a8dccb59aa8ad07e18"
>> ========DONE========
>> FAIL Testing imagecolorallocatealpha()
>> [C:\php-sdk\php70\vc14\x64\php-src\ext\gd\tests\imagecolorallocatealpha_basic.phpt]
>> TEST 2/3 [C:\php-sdk\php70\vc14\x64\php-src\ext\gd\tests\imageconvolution_basic.phpt]
>> ========DIFF========
>> 001+ 0b35b0ded5e20eff78f4cd7850579dab
>> 001- 20979b45f8772cdbd78262af4e332638
>> ========DONE========
>> FAIL Testing imageconvolution() of GD library
>> [C:\php-sdk\php70\vc14\x64\php-src\ext\gd\tests\imageconvolution_basic.phpt]
>> TEST 3/3 [C:\php-sdk\php70\vc14\x64\php-src\ext\gd\tests\libgd00100.phpt]
>> ========DIFF========
>> 001+ 155d2437ff8000e68ae703ff198ad926
>> 001- df7253c765280396f303166f10ba9283
>> ========DONE========
>>
>> Seems to be related to the test changes in this or the decsendant commits. Could you please
>> check?
>
> Indeed, on Windows the tests are failing. A quick check indicates that
> imagegd() doesn't behave identical. I'll investigate right away.
Well, imagegd() behaves rather unexpected for truecolor images. Even
though the GD image format is able to store truecolor images[1], the PHP
binding converts these to palette images using dithering[2], which is
system dependent[3]. The few failing tests on Windows already hint at
this problem, but on other systems more/other tests might fail.
The cleanest solution would be to change the PHP binding to not convert
to palette, but that obviously would break BC, and there still might be
a problem when saving truecolor images in GD format[4].
Reverting back the commit (i.e. comparing the PNG hashes instead of the
GD hashes) would solve the test failures for the bundled libgd, but
would leave several failures with external libgd.
Switching to output in GD2 image format might also exhibit system
dependent behavior (I'm not sure, but GD2 allows for zlib compression…)
Perhaps PR #1949[5] should be considered to be merged into PHP-5.6+?
Thoughts?
BTW: <http://qa.php.net/reports/run_tests.php> is
still
dysfunctional[6]. It might be useful, though, to be able to have a look
at those reports to better cater to system depend behavior.
[1] <https://github.com/libgd/libgd/blob/gd-2.2.3/src/gd_gd.c#L298-L302>
[2] <https://github.com/php/php-src/blob/PHP-7.0.10/ext/gd/gd.c#L2579-L2581>
[3]
<https://github.com/php/php-src/blob/PHP-7.0.10/ext/gd/libgd/gd_topal.c#L1785>
[4] <https://github.com/php/php-src/commit/e8e24200>
[5] <https://github.com/php/php-src/pull/1949>
[6] <https://bugs.php.net/bug.php?id=72485>
--
Christoph M. Becker