JohannesBuchner / imagehash

A Python Perceptual Image Hashing Module
BSD 2-Clause "Simplified" License
3.19k stars 329 forks source link

load imagehash.crop_resistent_hash #160

Closed themetalleg closed 2 years ago

themetalleg commented 2 years ago

Hi,

I am saving the image hashes of the crop_resistent_hash in a database with: chash = imagehash.crop_resistant_hash(img).__str__() Now I want to load this hash again, but cannot find a way.

The other hashes I can load with either hex_to_hash or hex_to_flathash, but this one not. I also tried to work with ImageMultiHash, but no success.

Would be great if somebody could help.

fayyazraja commented 2 years ago

hi, did you find anything for it?

themetalleg commented 2 years ago

no, unfortunately not.

JohannesBuchner commented 2 years ago

You can make a string from a ImageHash object with str()

You can make a string from a ImageMultiHash object with str(), which is a comma-separated list of what the above would return.

For the reverse:

You can make a ImageHash object from a string with hexto(flat)hash

You can make a ImageMultiHash object by passing a list of ImageHash objects.

JohannesBuchner commented 2 years ago

fixed with #166