imagehash
imagehash copied to clipboard
how compare from string eg. file_get_contents()
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