Basic Usage
jalotra opened this issue · 2 comments
I have a doubt about the Basic Usage section.
I believe hash
and otherHash
have bit lengths: 14 * 4 and 15 * 4 respectively.
As len('ffff3720200ffff') = 15 and len('d879f8f89b1bbf') = 14.
Then why doesn't the Imagehash.__sub__
raised a TypeError
as described in code?
Yeah, the imagehash hex generation creates the smallest hex value, but it isn't actually a valid hex string because it trails a single 4 bit value (0xF
) instead of padding out to 8 bits (0x0F
).
I fixed the hex generation (along with adding many more output formats) in my cleanup branch over at https://github.com/mattsta/imagehash — but, because the hex generation changed (now with correct hex string lengths), the new output doesn't interoperate with the old output.
I am closing this, as it seems to have been a question. If you want to file a bug, please open a new issue.