KilianB / JImageHash

Perceptual image hashing library used to match similar images
MIT License
407 stars 83 forks source link

Update Hash.java #47

Open mpeters-tha opened 4 years ago

mpeters-tha commented 4 years ago

Changed on equals method to use "instanceof" to check the 2 objects class instead of "obj.getClass()". This is for when you create a hash using bigInteger contructor which create a Hash object, while if create a hash from an image, the object will be of the hash algorithm type you have chosen, and the equals will return false while the 2 are in fact equals.

KilianB commented 4 years ago

Thanks, I'll have a look at it to see if it breaks identity or importing in any other way

mpeters-tha commented 3 years ago

Hello,

Do you know if this will be pushed in the master branch ?

Regards, Matthieu

KilianB commented 3 years ago

I will release a new version this Saturday fixing older issues as well. For a better serialisation it might make sense to also include more class information into the saved state. Next week this issue will be fixed.

KilianB commented 3 years ago

Code is ready, but a few tests still need to be written.