Re: ext/gd adding imagecompare

From: Date: Tue, 09 Jul 2024 17:09:26 +0000
Subject: Re: ext/gd adding imagecompare
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi Saki.

On Tue, 9 Jul 2024 at 17:49, Saki Takamachi <[email protected]> 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


Thread (10 messages)

« previous php.internals (#124310) next »