From 0dd9d1dbcd3ac0488586d9a29a80540d5763e415 Mon Sep 17 00:00:00 2001 From: Nishita Date: Wed, 30 May 2018 14:04:49 -0700 Subject: [PATCH] For images with all pixels of the same RGB value, this condition is never true and hence returns 0 hash. current >= median solves this problem. --- src/pHash.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pHash.cpp b/src/pHash.cpp index 07b03ad..1da187f 100644 --- a/src/pHash.cpp +++ b/src/pHash.cpp @@ -394,7 +394,7 @@ int ph_dct_imagehash(const char* file,ulong64 &hash){ hash = 0x0000000000000000; for (int i=0;i< 64;i++){ float current = subsec(i); - if (current > median) + if (current >= median) hash |= one; one = one << 1; }