Newsgroups: php.internals,php.qa Path: news.php.net Xref: news.php.net php.internals:94090 php.qa:67731 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88611 invoked from network); 17 Jun 2016 19:11:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jun 2016 19:11:13 -0000 Authentication-Results: pb1.pair.com header.from=me@daveyshafik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@daveyshafik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daveyshafik.com from 209.85.220.181 cause and error) X-PHP-List-Original-Sender: me@daveyshafik.com X-Host-Fingerprint: 209.85.220.181 mail-qk0-f181.google.com Received: from [209.85.220.181] ([209.85.220.181:33272] helo=mail-qk0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 21/CB-18862-05B44675 for ; Fri, 17 Jun 2016 15:11:13 -0400 Received: by mail-qk0-f181.google.com with SMTP id a186so94686519qkf.0 for ; Fri, 17 Jun 2016 12:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daveyshafik-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=eNQP41NF6qN6yY/L5LcJeQsxpjeSBqW027yIKjkBJ5I=; b=hCwvdRYssyICySygAS9wP72j85RRx4EfWUotKNOOmLnXJ176IJozg6+j5olAhOMLc5 i5wpbvyYdONKZEi1EQTYqeUImD611pxKuJ9Re/LTKyy0+np6uCMTrvwLNAGs9lNUeCnh AYSqE6dsHmA9WaawQoiVV/CMPUwHWg0G8wxBHTAlyVyN6bDskhl+phhLdrpbq4ursDaO gahoHgnjTP0EdYhIoYBNske2IFCcjjI3L5PvR0tqLGe/IN3LroeXhHFcDF1jQkJlvwiK jfM/uC9cWNAZXd2Zh1ak/2PiM6Z3RDVcv2ZnX0C9wC6IR4dh1JSAzx0IRjo13CA5xVI3 Hsnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=eNQP41NF6qN6yY/L5LcJeQsxpjeSBqW027yIKjkBJ5I=; b=BO/hWUmRlbvBqH1WJEQ9vViULohY93E5QZ51+lCXM93M7/z1AOWHccJ43mH4wy6RNL PafSfrgeIMmNm7SiwZPPUZhr7Ab824DW8RPa39Kti311naZTF1nRzdg2JdJrgi439ASS zPMK2xMzEbBUOCWTX7fr6dYncxj9Gy0ZFQ/sLfQA8ZQ8TRFzHp7lKFry6j4Aoka1Suiz PCv8HBfm9EnL5sCS++sNagaexvfJfYligVQyzEZNK6J3a6ImkcgeOUaJVlIfsNOVyUl7 Ndq0QlAPCnntqKnlKwVvVKhcm5WOrdMKlitaj+SIB2rNmOEOGW6nG7DPaMpfx4ae9RGT eQfQ== X-Gm-Message-State: ALyK8tLv7MNkH1K0PIx+3qvvVMxBIDvDRQtAHJVWUSm4xqO9DCdjm6+o27PYOflANF2ynV4/dWIQZ3G+77SS+Yos X-Received: by 10.55.130.1 with SMTP id e1mr4374143qkd.139.1466190669685; Fri, 17 Jun 2016 12:11:09 -0700 (PDT) MIME-Version: 1.0 Sender: me@daveyshafik.com Received: by 10.237.54.225 with HTTP; Fri, 17 Jun 2016 12:11:08 -0700 (PDT) In-Reply-To: References: <9f856dde-ae99-99fa-14b8-0e0fad004b9c@gmx.de> Date: Fri, 17 Jun 2016 12:11:08 -0700 X-Google-Sender-Auth: _OhiUUUNBqkWzfjI_KGhIdcDP9g Message-ID: To: Pierre Joye Cc: Christoph Becker , PHP internals , PHP Quality Assurance Team Mailing List Content-Type: multipart/alternative; boundary=94eb2c070e1a0a60bb05357e1eea Subject: Re: [PHP-DEV] Re: Improve GD test suite From: davey@php.net (Davey Shafik) --94eb2c070e1a0a60bb05357e1eea Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I would love to see a native ssim/dssim implementation in PHP=E2=80=A6 On Fri, Jun 17, 2016 at 6:54 AM, Pierre Joye wrote: > 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 th= e > > 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. Alternative= ly > 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 > --94eb2c070e1a0a60bb05357e1eea--