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

Make probeStream accept an options object #67

Closed abettadapur closed 2 years ago

abettadapur commented 2 years ago

To keep these interfaces consistent, let's make probeStream accept an options object with 'keepOpen' as a property

Fixes #66

abettadapur commented 2 years ago

@puzrin Lmk if this change makes sense!

puzrin commented 2 years ago

I don't see reasons for this change and don't like to change api "just for fun". Http and stream probers are different things, why should they have similar options?

abettadapur commented 2 years ago

Hi @puzrin, agree we should be careful with API changes. I thought this change might be useful to reduce the differences between the top level APIs

i.e. probe('', {}) and probe(stream, true) become probe('', {}) and probe(stream, {})

Feel free to close if you think this is not worth the change

puzrin commented 2 years ago

Let's keep all as is. Those methods looks similar only at first glance, but are very different by nature. Also, api is battle-tested and stable.