jenssegers / imagehash

🌄 Perceptual image hashing for PHP

Home Page:https://jenssegers.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncaught Error: Call to a member function toHex()

KarlsDad opened this issue · comments

commented
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?

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.