imagehash icon indicating copy to clipboard operation
imagehash copied to clipboard

Uncaught Error: Call to a member function toHex()

Open KarlsDad opened this issue 6 years ago • 1 comments

include('vendor/autoload.php');

use Jenssegers\ImageHash\ImageHash;
use Jenssegers\ImageHash\Implementations\DifferenceHash;

$hasher = new ImageHash(new DifferenceHash());
$hash = $hasher->hash('img/forest-copyright.jpg');

echo $hash->toHex();` <----- Fatal error: Uncaught Error: Call to a member function toHex() on string ...

Why?

KarlsDad avatar Aug 27 '18 08:08 KarlsDad

I have this issue as well. Seems like the ->hash() method returns a hex string rather than an object. I think the doc might be out of date.

AnonymousArthur avatar Sep 28 '18 03:09 AnonymousArthur