philipjscott / simple-thumbnail

A library that produces thumbnails from images, videos and URLs :mag_right:
https://www.npmjs.com/package/simple-thumbnail
MIT License
25 stars 14 forks source link

Return a read stream if output path is NULL #28

Closed philipjscott closed 5 years ago

philipjscott commented 6 years ago

Is your feature request related to a problem? Please describe.

I want to pipe thumbnail data to S3.

Describe the solution you'd like

If the user passes in null for the output path, simple-thumbnail will resolve to a read stream.

Describe alternatives you've considered

I've considered making the thumbnail size an option rather than an argument, and making the output path optional (undefined -> output a read stream), but I don't want to make a breaking change.

Additional context

http://tutturu.tv

Hype incoming :^)

philipjscott commented 6 years ago

Welp, this doesn't seem to be possible: https://superuser.com/questions/1213776/thumbnail-is-not-added-when-sent-to-stdout-but-works-when-made-a-file/1213848

I suppose I'll just have to write to a temp file then pipe it? D:

philipjscott commented 6 years ago

Keeping this open in case a wizard comes :3

cmd430 commented 5 years ago

I got it to work with output streams, (not returning a stream just using one) https://github.com/cmd430/simple-thumbnail/commit/df17a33ca87cd94cbaa29a3308f3c366d2cd4ca1

philipjscott commented 5 years ago

Released in 1.4.0! :tada: :clap: :tada:

Thanks cmd for your help :)