gm-buffer

A plugin for gm module, which enables simple buffering of image binary for later content-length detection.

npm install gm-buffer
2 downloads in the last day
12 downloads in the last week
51 downloads in the last month

A plugin for gm node module, which enables simple buffering of image binary for later content-length detection.

Installation

npm i gm
npm i gm-buffer

Usage

var gm = require('gm');

require('gm-buffer');

gm('/me.jpg')
    .resize(canvas.width, canvas.height, '^')
    .gravity('Center')
    .buffer(function(err, buf) {
        console.log(buf.length);
    });
npm loves you