Tests: flatten to mid-grey before generating fingerprint

This commit is contained in:
Lovell Fuller 2019-11-14 13:18:14 +00:00
parent 88a3919ce0
commit 11daa3b4d1

View File

@ -13,6 +13,7 @@ const getPath = function (filename) {
// Based on the dHash gradient method - see http://www.hackerfactor.com/blog/index.php?/archives/529-Kind-of-Like-That.html
const fingerprint = function (image, callback) {
sharp(image)
.flatten('gray')
.greyscale()
.normalise()
.resize(9, 8, { fit: sharp.fit.fill })