imagehash icon indicating copy to clipboard operation
imagehash copied to clipboard

how compare from string eg. file_get_contents()

Open erlangparasu opened this issue 4 years ago • 1 comments

erlangparasu avatar Aug 26 '19 05:08 erlangparasu

I didn't test but jenssegers/imagehash is internally using Intervention/image to load the image so the following should work:

$hasher->hash(file_get_contents('image.png'));

See: http://image.intervention.io/api/make

Then if you want to compare the hash of the image above, you can use the compare() method. https://github.com/jenssegers/imagehash/blob/7bd7f2d2b0fd44ef473d99359fe8c27f1f516784/src/ImageHash.php#L46

artyuum avatar Aug 21 '20 22:08 artyuum