update version 1.9.0, throw an error if node version is not supported

master
Jonathan Ong 11 years ago
parent f7c0876d5b
commit bc7a81d4d2
  1. 2
      History.md
  2. 2
      index.js
  3. 28
      lib/command.js
  4. 2
      package.json

@ -1,4 +1,4 @@
1.8.3pre
1.9.0
==================
* added; node v0.10 support

@ -7,7 +7,7 @@ var Stream = require('stream').Stream;
var EventEmitter = require('events').EventEmitter;
var util = require('util');
util.inherits(gm, EventEmitter)
util.inherits(gm, EventEmitter);
/**
* Constructor.

@ -15,6 +15,7 @@ var series = require('array-series');
var missingIM = '** Have you installed imageMagick? **\n';
var missingGM = '** Have you installed graphicsmagick? **\n';
var noBufferConcat = 'gm v1.9.0+ required node v0.8+. Please update your version of node, downgrade gm < 1.9, or do not use `bufferStream`.';
/**
* End event for child_process
@ -184,28 +185,27 @@ module.exports = function (proto) {
self.sourceStream.pipe(proc.stdin);
// We cache the buffers for get operations
// as we may use it again.
// This wouldn't make sense for a convert operation.
// We rely on garbage collection for optimization,
// so if want to kill trash the garbage quickly,
// do `this._buffers = null`.
// We do this in lieu of `bufferStream`,
// with this being more magical.
// bufferStream
// We convert the input source from a stream to a buffer.
if (self.bufferStream && !this._buffering) {
if (!Buffer.concat) {
throw new Error(noBufferConcat);
}
// Incase there are multiple processes in parallel,
// we only need one
this._buffering = true
var buffers = []
self._buffering = true;
var buffers = [];
self.sourceStream.on('data', function (chunk) {
buffers.push(chunk)
buffers.push(chunk);
})
// Kill reference as we assume the stream is dead.
self.sourceStream.on('end', function () {
self.sourceBuffer = Buffer.concat(buffers)
self.sourceStream = null
self.sourceBuffer = Buffer.concat(buffers);
// Kill reference as we assume the stream is dead.
self.sourceStream = null;
})
}
}

@ -1,6 +1,6 @@
{ "name": "gm"
, "description": "GraphicsMagick for node.js"
, "version": "1.8.3-pre"
, "version": "1.9.0-pre"
, "author": "Aaron Heckmann <aaron.heckmann+github@gmail.com>"
, "keywords": ["graphics", "magick", "image", "graphicsmagick", "imagemagick", "gm", "convert", "identify", "compare"]
, "engines": { "node": ">= 0.8.0" }

Loading…
Cancel
Save