Add the method similarity()
This commit is contained in:
parent
f4f503047e
commit
c58775dcc3
@ -86,6 +86,11 @@ class PerceptualHash {
|
||||
return (int)$diff;
|
||||
}
|
||||
|
||||
public function similarity($file)
|
||||
{
|
||||
return 1 - ($this->compare($file) / strlen($this->bin));
|
||||
}
|
||||
|
||||
protected function load($file)
|
||||
{
|
||||
if (!file_exists($file)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user