pwlmaciejewski / imghash

Perceptual image hashing for Node.js
MIT License
167 stars 19 forks source link

The then method is always slow #44

Closed snoopy83101 closed 4 years ago

snoopy83101 commented 4 years ago

The then method is always slow, how can it be faster? Is it possible to increase the timeout configuration?

pwlmaciejewski commented 4 years ago

@snoopy83101 Can you provide a test repo where the hash method is slow?

Is it possible to increase the timeout configuration?

I don't follow. Can you explain?

snoopy83101 commented 4 years ago

I am sorry I am using Google Translate.

When processing certain large pictures, it usually takes more than 5 seconds to obtain the hash.

I don't know much about this knowledge, it becomes much faster after I configure it like this imghash .hash(o.path, 4, "binary") .then((hash) => { resolve(hash); }) .catch((e) => { reject(e); });

pwlmaciejewski commented 4 years ago

Thanks @snoopy83101 Could you also provide the image for which it takes so long?

pwlmaciejewski commented 4 years ago

@snoopy83101 Closing for now, please re-open with the image to reproduce the issue.