|
|
|
@ -188,7 +188,17 @@ module.exports = function (proto) { |
|
|
|
|
err = new Error("gm().stream() or gm().write() with a non-readable " + |
|
|
|
|
"stream. Pass \"{bufferStream: true}\" to identify() " + |
|
|
|
|
"or getter (size, format, etc...)"); |
|
|
|
|
return callback.call(this, err); |
|
|
|
|
return cb(this, err); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// handle streaming to gm errors when gm/imageMagick is not installed
|
|
|
|
|
proc.stdin.on('error', handlerr); |
|
|
|
|
proc.stdout.on('error', handlerr); |
|
|
|
|
function handlerr (err) { |
|
|
|
|
if ('EPIPE' == err.code && 'write' == err.syscall) { |
|
|
|
|
err.message = missingBinMsg(self) + err.message; |
|
|
|
|
} |
|
|
|
|
cb(this, err); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
self.sourceStream.pipe(proc.stdin); |
|
|
|
@ -229,11 +239,11 @@ module.exports = function (proto) { |
|
|
|
|
err.code = code; |
|
|
|
|
err.signal = signal; |
|
|
|
|
}; |
|
|
|
|
callback.call(this, err, stdout, stderr, cmd); |
|
|
|
|
cb(this, err, stdout, stderr, cmd); |
|
|
|
|
stdout = stderr = onOut = onErr = onExit = null; |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
callback.call(this, null, proc.stdout, proc.stderr, cmd); |
|
|
|
|
cb(this, null, proc.stdout, proc.stderr, cmd); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return this; |
|
|
|
|