node-phash icon indicating copy to clipboard operation
node-phash copied to clipboard

Input a Stream or a Buffer?

Open chinajuanbob opened this issue 9 years ago • 6 comments

Is it possible to input a Stream or a Buffer of image instead of a file path? Thanks!

chinajuanbob avatar Apr 23 '15 07:04 chinajuanbob

Hi @chinajuanbob! that would be good.

What I am doing is to request (NPM request) the image from a URL, then using fs I save the request.body into a file in a tmp dir to then apply the pHash.imageHashSync(file). Finally I remove the tmp file.

Hope it help.

toxaco avatar Jan 18 '17 17:01 toxaco

Would like to know too!

yaneony avatar Sep 04 '17 22:09 yaneony

Same here, would be awesome to be able to do this on a Buffer (or Stream)

bobmoff avatar Oct 28 '17 22:10 bobmoff

Yes please on a buffer.

srameshr avatar Jan 09 '18 13:01 srameshr

Any update on this? Is this implementation still being maintained? Thanks.

aecorredor avatar Nov 21 '18 17:11 aecorredor

seems like we have to use the workaround instead

8zf avatar Jun 11 '20 02:06 8zf