nodeca / probe-image-size

Get image size without full download. Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF, SVG, PSD, ICO.
MIT License
978 stars 77 forks source link

Version without fs dependency? #41

Closed styxlab closed 4 years ago

styxlab commented 4 years ago

Thanks a lot for this nice package!

Would it be possible for you to make a version without fs dependency? If you probe image size from an url stream, you don't need fs. Currently I cannot use this package in serverless lambda functions because of this dependency. The package buffer-image-size is a good example of a similar approach without fs.

Thanks for your consideration.

puzrin commented 4 years ago

This package has no fs dependency

hoanghiep commented 3 years ago

@puzrin

https://github.com/tomas/needle/blob/d2909e2a5f89ceeff0c29320d3a045afe47b2638/lib/multipart.js

fs has been used by needle (multipart).

How can i use this package in client side?

puzrin commented 3 years ago

@hoanghiep node.js downloader can not work on client for obvious reasons. I would suggest to 'reqiure' sync part only, download full file and use sync method.