GraphicsMagick/ImageMagick image processor module
- Source:
- See:
(require("src/processor/image/gm"))(operation, pipeline, stream) → {Stream}
Function that takes an array with processing operations and returns a function that can be called with an stream.
The function will return a promise and resolve a stream.
This stream is converted by gm using the given processing operations.
Parameters:
Name | Type | Description |
---|---|---|
operation |
object | |
pipeline |
function | Function to generate a transformer pipeline that is used with the incoming stream |
stream |
Stream | stream containing image |
- Source:
Returns:
transformed stream
- Type
- Stream
Example
image([{ id: 'format', format: 'jpg'}])(fs.createReadStream('sample.png')
.then((resultStream) => {...})