Newsgroups: php.internals,php.qa Path: news.php.net Xref: news.php.net php.internals:94082 php.qa:67730 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62246 invoked from network); 17 Jun 2016 13:54:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jun 2016 13:54:54 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.50 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.218.50 mail-oi0-f50.google.com Received: from [209.85.218.50] ([209.85.218.50:33059] helo=mail-oi0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 19/97-18862-D2104675 for ; Fri, 17 Jun 2016 09:54:54 -0400 Received: by mail-oi0-f50.google.com with SMTP id u201so117982579oie.0; Fri, 17 Jun 2016 06:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=pUBW4Fyipgpj1OUf+mBZCUf4P3LNHGj6QMwW6cXb8Vc=; b=nraKuPvtvy4plIu7l5ZB+VaMYKUEhgHiqpFbqlBHhwIc3seZaZIMIzYlJmbVnTYBgA x3fOEXOhdWeGrbjKr28rMpfaLd6xZ2gjLANFTPSp+GqheC9TMQJy+YEkB8UxKiaYNFx8 L4zSknCZNQZXM0tEeNZyhc2+aXf6VhOcIxjAuWev8QB+EjrCrERgAO6AIshwbIYkwZBd nQr30YWLlGt8i1HtdJZLslLcsztYCVpLkHJLhIikkVluAU8TiiI+HcgbR/c4u3YpdfUH u+brDWpTwgl0zLPEjq+epO7i9fOZ9Wd0MlmseXi8fFXKjU7PkScZujwnbT8Vl3w1Mn4w mtSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=pUBW4Fyipgpj1OUf+mBZCUf4P3LNHGj6QMwW6cXb8Vc=; b=W1+GkxZxuzLX7gVceLE1R8MKX7HU+gdFsit4HY+ynN8whPq75bAwL445AkJyxSSFjO d0joRhL5fpZRMhBoDywmO5jRlqfeCPxQPg8EXmzfg9lu031YinXmuYA46LNA37Lbvgj3 1uwnFQwQduDsLB1nN4TJr5ZcxuJ7E0csQAgQyzyY/l2rbjGUePUIuoQITdeoi0BHEMa+ Iyp1C1hPxSL3PU+CRoDIgRd5WgPAmBlYYD/7qzjqmNN3i+QRCBoy1KxVAYU5xO0jDNFw zrjAJWDX/b8ylSoMCFd2wmbw8qaPIYFTWj8hAILpyOXFNr52y0NvYFI7pZq3pq0FZQRn xSCQ== X-Gm-Message-State: ALyK8tL2fOCand3mK9ai6R2AuMhvSxGwtTUx9DIse/MaGiqEJhxtxRmFNGulyFQoNagcl4SWzzDgBPYYhJ/NCQ== MIME-Version: 1.0 X-Received: by 10.202.183.87 with SMTP id h84mr1384651oif.151.1466171691197; Fri, 17 Jun 2016 06:54:51 -0700 (PDT) Received: by 10.202.108.197 with HTTP; Fri, 17 Jun 2016 06:54:50 -0700 (PDT) Received: by 10.202.108.197 with HTTP; Fri, 17 Jun 2016 06:54:50 -0700 (PDT) In-Reply-To: References: <9f856dde-ae99-99fa-14b8-0e0fad004b9c@gmx.de> Date: Fri, 17 Jun 2016 20:54:50 +0700 Message-ID: To: Christoph Becker Cc: PHP internals , PHP Quality Assurance Team Mailing List Content-Type: multipart/alternative; boundary=001a113cd35ad56c0c053579b285 Subject: Re: Improve GD test suite From: pierre.php@gmail.com (Pierre Joye) --001a113cd35ad56c0c053579b285 Content-Type: text/plain; charset=UTF-8 Hi On Jun 17, 2016 8:18 PM, "Christoph Becker" wrote: > > 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? The current testing code is under new bsd, so there is no license issue here. I plan to improve the current code to be more useful as well as adding perceptual diff. My initial idea was to use pdiff. It is under gpl but as it uses only for the tests suite it is ok. Sadly not for php. Alternatively the cmd pdiff can be used but it is then slower. In any case we can expose the image diff functions in ext/gd but it will need some work on the results to be useful in the wild. It should also be easy to write a script to port test from c to/from php to complete both side testing. Thanks for bringing that up :) Cheers Pierre --001a113cd35ad56c0c053579b285--