Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124310 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id C41791A00B7 for ; Tue, 9 Jul 2024 17:09:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1720545066; bh=E1DrvW9GEToxdIQbl5GbnWy8S1m4WMrVYB7WlZRVQGI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=H84luGW4PathxqPKpk6rVYUTY/+D5NmFIwx+fOgciJATTwuO/3AIy7LxwtJA//moY IdiYngmScgXTJC9LvxEe9ecTJNGe2jbJG+OdB3kk3b5eMtKnNGGEpTSLkYAjSBpw2i StTntWwjCSV4jEEkJ9aKr7srsdn1Ers0DPAabrGkMogTMtOculD+IdEGdoJrT88Ms1 eq6tVWKGBIaEWGEWIBgEExUoBS7/j4WgYrILs/gYLN1IxUVHmkTxbBEvb3Ai8+9KOj 9rkT0bZpDqtngwnCpMzgWL1PAd7TwqINocDtTLjh2xdmUKmwM9YYcG6yEgu7L4lFV/ aiB5mAoMW3UnA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 47F9E18085F for ; Tue, 9 Jul 2024 17:11:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 9 Jul 2024 17:11:05 +0000 (UTC) Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-58b447c519eso6707209a12.3 for ; Tue, 09 Jul 2024 10:09:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720544979; x=1721149779; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=E1DrvW9GEToxdIQbl5GbnWy8S1m4WMrVYB7WlZRVQGI=; b=JaG3YsgbDu0JPq3wEXSp7+vjB108Ax9KYKdHrXP3+14OqRrDUYHtIV9H0EDCQTj47D m0TQTacXkhKha/pvf5G0T+J7G/ZSdJ7A1OEzuND8mUuH9VwDCJ4K32Pus9kq1R5bmPAT bCxptWR1zztfewGXYkLXANBTf6P08NLnXLh0v9g6QEh4PSAXwQ3HLeRj0CazvUp0ZR7B fekrgfka+dIJ+QGnoJfJcE5l8FV5hNk2aBgMXpIcHuhQGX49nH9xioZKPW2eB9mWB/4k IU9iV+wEl85Gqvwl0/mY3ceYMSMbK2lEvMnt5GDlbNSjjI7L4Mvb4RYjjxwbp58grfC7 KKYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720544979; x=1721149779; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=E1DrvW9GEToxdIQbl5GbnWy8S1m4WMrVYB7WlZRVQGI=; b=nHpShfzXQ2ThTmv5K/fsglF9xA1uWvkOttrVWYabi6sAiXGytX8cddiF5Bj4aN3XBq Sg1jA0cCWoTKOgNjwQ58VFLbNmAlrYg/XGZ0ESubrMADiWiPzDjt0SkMAU0yQO5f0/gy z8UsjOSfAK2XUoyv+TgLh1ugs1Le2aNEbelI7TU5dTnVOnuT177cCQuyyDElMtCYBrcS 2wqlWb6aL1TfTK2XZ7s5OSvNnNqWo1CVAxM+kAqiMmJYG5nIZir5nlTT+CqsjXidGfkV VYogtLN41QDNmqYFGVuJfEfcBXeX+Na14TcXyO5zGb/YqLrjOXFAXUGH6FE1kO2+1a2q 9buQ== X-Gm-Message-State: AOJu0Ywdm3j3iUF5SzTfn2+RW8Fv/DEEgGdAXs6jsBn8Qy/eVzcmOWrp lRiEtlEE4zGiKpI32Z6tGt8PgRjcQSFzAOGP53GQpOpKBnYyyS7PTFVvKCNnAoGvdtka1OPo4CP 4lrOvSBb6ciTyF+K2pGLSsCGlmpM= X-Google-Smtp-Source: AGHT+IGpomH99e83LjjjUmxb7SkJY3kHNS+aZIXwZ9q7frymmdkR3BaNcQ0gVyE/6W/Ey/ScgaV/N2judK3Q0FkzgDc= X-Received: by 2002:a17:906:2819:b0:a77:a415:f815 with SMTP id a640c23a62f3a-a780b6b1f41mr188138566b.20.1720544978904; Tue, 09 Jul 2024 10:09:38 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: <3CA7F710-D305-497D-910D-320372A61A6C@sakiot.com> In-Reply-To: <3CA7F710-D305-497D-910D-320372A61A6C@sakiot.com> Date: Tue, 9 Jul 2024 18:09:26 +0100 Message-ID: Subject: Re: [PHP-DEV] ext/gd adding imagecompare To: Saki Takamachi Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000049aed8061cd3983a" From: devnexen@gmail.com (David CARLIER) --00000000000049aed8061cd3983a Content-Type: text/plain; charset="UTF-8" Hi Saki. On Tue, 9 Jul 2024 at 17:49, Saki Takamachi wrote: > Hi David, > > > Hi, > > > > I plan to add imagecompare to the gd extension. No problem so far > however a little discussion of the returned value > > > > https://github.com/php/php-src/pull/14877#issuecomment-2217686123 > > > > I personally see a value of a bitmask rather than just boolean which is > not harder to handle than imagetypes. > > > > Let me know your thoughts. > > > > Cheers. > > If the return value is bool, does this mean that it will be true if the > comparison targets are exactly the same, and false if there is even one > difference? In other words, will we no longer be able to see where the > differences were? > > It seems to be the opposite regarding his proposition gdImageCompare(im1, im2) & GD_CMP_IMAGE. Then yes you are right, we are losing the specifics. If you want to figure out how the image 1 and image 2 differ, you need to use the rest of the api e.g. imagecolortransparent and all that jazz ... A bit too complex I feel. > Regards, > > Saki --00000000000049aed8061cd3983a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Saki.

On Tue, 9 Jul 2024 at 17:49, Saki Takamachi &= lt;saki@sakiot.com> wrote:
Hi David,

> Hi,
>
> I plan to add imagecompare to the gd extension. No problem so far howe= ver a little discussion of the returned value
>
> https://github.com/php/php-src= /pull/14877#issuecomment-2217686123
>
> I personally see a value of a bitmask rather than just boolean which i= s not harder to handle than imagetypes.
>
> Let me know your thoughts.
>
> Cheers.

If the return value is bool, does this mean that it will be true if the com= parison targets are exactly the same, and false if there is even one differ= ence? In other words, will we no longer be able to see where the difference= s were?


It seems to be the opposite regarding = his proposition=C2=A0gdImageCompare(im1, im2) & GD_CMP_IMAGE. Then yes you are right, we are losing the specifics. If yo= u want to figure out how the image 1 and image 2 differ, you need to use th= e rest of the api e.g. imagecolortransparent and all that jazz ... A bit to= o complex I feel.
=C2=A0
Regards,

Saki
--00000000000049aed8061cd3983a--