Currently writing a node-based utility based on the node imagemagick library to take in a stream and output another stream to STDOUT:
im = require('imagemagick')
request = require("request")
sampleImage = "http://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg"
request.get(sampleImage, (err, res, body) ->
prefix = "-"
switch (res.headers['content-type'])
when "image/jpeg"
prefix = "jpg:-"
when "image/png"
prefix = "png:-"
taskHash = {
srcPath: prefix
srcData: body
dstPath: -
height: 100
}
callback = (err, stdout, stderr)->
if err
console.error(err)
process.exit(1)
console.log(stdout)
im.resize(taskHash, callback)
)
Getting the following error:
events.js:72
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at errnoException (net.js:904:11)
at Object.afterWrite (net.js:720:19)
Have noticed a similar error discussed here, but I think that this is a separate case, since I'm not using the graphicsmagick library. Is it not possible to use buffers without installing both imagemagick and graphicsmagick?