added; proto.selectFrame(#). closes #202

master
Jonathan Ong 11 years ago
parent fd8c16df64
commit 89f9511d5d
  1. 7
      lib/args.js
  2. 20
      test/selectFrame.js

@ -10,6 +10,13 @@ var argsToArray = require('./utils').argsToArray;
*/
module.exports = function (proto) {
// change the specified frame.
// See #202.
proto.selectFrame = function (frame) {
if (typeof frame === 'number')
this.sourceFrames = '[' + frame + ']';
return this;
}
// define the sub-command to use, http://www.graphicsmagick.org/utilities.html
proto.command = proto.subCommand = function subCommand (name){

@ -0,0 +1,20 @@
var assert = require('assert');
var fs = require('fs')
module.exports = function (_, dir, finish, gm) {
var m = gm(dir + '/original.gif[0]')
if (!gm.integration)
return finish();
m.identify('%#', function (err, hash1) {
if (err) return finish(err);
m.selectFrame(2).identify('%#', function (err, hash2) {
if (err) return finish(err);
assert.ok(hash1.toString().trim() !== hash2.toString().trim())
finish();
})
})
}
Loading…
Cancel
Save