Skip to content

Commit

Permalink
update version 1.9.0, throw an error if node version is not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanong committed Apr 15, 2013
1 parent f7c0876 commit bc7a81d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion History.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1.8.3pre
1.9.0
==================

* added; node v0.10 support
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
28 changes: 14 additions & 14 deletions lib/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ "name": "gm"
, "description": "GraphicsMagick for node.js"
, "version": "1.8.3-pre"
, "version": "1.9.0-pre"
, "author": "Aaron Heckmann <[email protected]>"
, "keywords": ["graphics", "magick", "image", "graphicsmagick", "imagemagick", "gm", "convert", "identify", "compare"]
, "engines": { "node": ">= 0.8.0" }
Expand Down

0 comments on commit bc7a81d

Please sign in to comment.