Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8197829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:49:17+00:00 2026-06-07T05:49:17+00:00

I am trying to pipe data from a stream into a child process. var

  • 0

I am trying to pipe data from a stream into a child process.

var gm = spawn( 'gm convert - -thumbnail 220x165^ -gravity center -extent 220x165 thumb.jpg' );
var rs = fs.createReadStream( 'cow.jpg' );

rs.pipe( gm.stdin )

Do I need to call end on gm for it to work? Also in my real code I am getting the stream from a database.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:49:18+00:00Added an answer on June 7, 2026 at 5:49 am

    Example of how to stream a request into imagemagick:

    var image = request.get(req.params.url);
    var size = req.params.size.split('x');
    var args = ['-', '-thumbnail', req.params.size + '^', '-gravity', 'center', '-extent', req.params.size, '-' ];
    var convert = spawn('convert', args);
    
    image.pipe(convert.stdin);
    convert.stdout.pipe(res);
    

    Great talk about this: http://vimeo.com/43380478

    And the source code: https://github.com/felixge/rebel-resize

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to read a stream of EXRs from one pipe, process them
I am trying to stream/pipe a file to the user's browser through HTTP from
I am trying to read unbufferd data from a pipe in Perl. For example
I'm trying to pipe data into cut to, say, cut away the first column
I'm trying to read lines from a pipe and process them, but I'm doing
I am trying to write the data using the pipe input streams. But from
I'm trying to extract fields from a pipe-delimited file and provide them as arguments
I'm trying to use the bash builtin read to read data from a file
I am trying to process IP addresses from traceroute ,which writes to a file
I am trying to read out data from a set of print statements in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.