KilianB / JImageHash

Perceptual image hashing library used to match similar images
MIT License
401 stars 81 forks source link

With 2.0.0 binary tree has to take hash length into account #10

Closed KilianB closed 5 years ago

KilianB commented 5 years ago

In MemoryImageMatcher fails unit test due to binary tree not sorting hashes correctly with smaller length.

https://github.com/KilianB/JImageHash/blob/ec734f16bfa870da46b322b76bb96a57768ce014/src/main/java/com/github/kilianB/dataStrorage/tree/BinaryTree.java#L113

Should be the difference between the bitLength and the hash.getBitResolution();. Add 0 padds for smaller hashes.

Add test cases to catch this error.

Related to #9