Newsgroups: php.internals,php.qa Path: news.php.net Xref: news.php.net php.internals:94081 php.qa:67729 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59502 invoked from network); 17 Jun 2016 13:18:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jun 2016 13:18:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.17.20 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.17.20 mout.gmx.net Received: from [212.227.17.20] ([212.227.17.20:56421] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8C/27-18862-4B8F3675 for ; Fri, 17 Jun 2016 09:18:45 -0400 Received: from [192.168.2.102] ([217.82.228.97]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LaoMe-1bgJWi3ScS-00kMOL; Fri, 17 Jun 2016 15:18:40 +0200 To: internals@lists.php.net, php-qa@lists.php.net Cc: Pierre Joye Message-ID: <9f856dde-ae99-99fa-14b8-0e0fad004b9c@gmx.de> Date: Fri, 17 Jun 2016 15:19:00 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:TbSX4HRIhb1MW6FMlijvjDNK9xt59lApB5NYis5Joi2azQjb6gB 6wRu2ABxDZbxsvtIckZFfT3L8bKPdT1fWwy2UWiM5FnKCWCW6TWafLOkYPJ40OYNqNZ/y5v Fmu+tzU6gz0M2BBFoRC5JRixP90u+cWRjsAu1hbdLawUVSBHzl32jeLe/w+U4Mpzw8INMBW xV1akLFVwQhxFDcH60Gbg== X-UI-Out-Filterresults: notjunk:1;V01:K0:nBCq52EguDc=:mue1xsmLAtRXc/o86mmp2L ulpm+SAtMNWfMxTYSuhtPBruDB4Cgda+nMdcZ88B8zFyyCU8T57h3NWHn1b9tzPrqbZ2Ro95J 3dj7sznPmbuwQL0nQ0k6v4Vl6nMjieD4fPouFHFJWqG4DfuU5v+/yY6hAosBMZaZTav0iwHHs W6SjvqQgq+q+gGu1K7ttCBTbLuUae1GACM9y/0eiTsmAAuJzqrQb2163QCoDTNT4vsMx+wJwd r6SsZdBUaVCe2c70/NsJoY/Eh10EOZdlYJY/gaZRXriIyCiiUOpZboiK/TCvy96t/l4i8dXqQ uyZBU4zhjzGB29J++fu5x1h9JFx7N6XWmmOu3YhOkOGm3J/HN9Ux8QoKLRif4r0jVQlYHIFLs tr73KzFxLj/ljHXLAfv3Xhp7NL+byyBUwj70bQmcqEPwQWymb2m1HmnTDZkwe3/w4BfhWABz0 AveUr1LBGP32aNYuvCyKtkVW9f++A3QEPYxOe03Wd7YdWjt6RdrENbWhuSSVCReg33vmHDWhd mRodRx38R4gXurT20w8q0YjRsurb8cglSBYOhJWA9R6eSzzMhnme29v72axsxUlctW/49MaiG tsllhenzwiW9HxBjui16BviRYQ7HX7nPP4adumz7KU+2HB1t0B5plQMgXTW6iaytOoAgZ+8Qq jhLPvxyVj9MJA7iALeWM1aDRPSToIysyqElZb4KNCGCiIo/o1/xF4cibJyrIL8/rdY2lpXcNc LGKV3/h6wSuahWxDNCNwDRqFDFotflXno7m+O1g7b81qkmPH/6IF4lNJVGeO8zN8IaPcYjefe /M0IWLS Subject: Improve GD test suite From: cmbecker69@gmx.de (Christoph Becker) Hi! I like to suggest to improve the current test suite of the gd extension. The main issue I see with the current suite is that many (~ 28) tests use md5() to verify that a drawn image is correct. However, as Pierre mentioned long ago[1], md5() does not work (reliably) for this purpose. An alternative would be to have prepared images, and to compare these with the actual resulting images pixel by pixel. While that might work fine for lossless compression, it still can result in failing tests, which would be hard to track down, and obviously a pure PHP implementation is slow. Especially, when it comes to verify lossy image compression a more sophisticated approach is required. Due to the necessity to test imagewebp() I had committed a very simplistic calc_image_dissimilarity() a while ago[2]. Obviously, this should be improved either regarding the algorithm as well as the performance. libgd already has a much better testing library written in C[3], which generates image diffs for failing tests, and we may consider to use parts of it for PHP. I can't see any issues regarding the license. Thoughts? [1] [2] [3] -- Christoph M. Becker