Permalink
Browse files

fixed; rotation by 0

closes #90
  • Loading branch information...
1 parent 8fcf3f8 commit b7c35ab2db0bfba0014b3c567916d651dce1d989 @aheckmann committed Nov 10, 2012
Showing with 14 additions and 3 deletions.
  1. +1 −1 lib/args.js
  2. +13 −2 test/rotate.js
View
@@ -728,7 +728,7 @@ module.exports = function (proto) {
// http://www.graphicsmagick.org/GraphicsMagick.html#details-rotate
proto.rotate = function rotate (color, deg) {
- return this.out("-background", color, "-rotate", deg);
+ return this.out("-background", color, "-rotate", String(deg || 0));
}
// http://www.graphicsmagick.org/GraphicsMagick.html#details-flip
View
@@ -1,11 +1,22 @@
// gm - Copyright Aaron Heckmann <aaron.heckmann+github@gmail.com> (MIT Licensed)
+var assert = require('assert')
+
module.exports = function (gm, dir, finish) {
gm
.rotate('red', -40)
- .write(dir + '/rotate.png', function rotate (err) {
- finish(err);
+ .write(dir + '/rotate.png', function rotate (err, _0, _1, cmd) {
+ assert.ok(/"-rotate" "-40"/.test(cmd));
+
+ gm
+ .rotate('red', 0)
+ .write(dir + '/rotate.png', function rotate (err, _0, _1, cmd) {
+ assert.ok(!/"-rotate" "-40"/.test(cmd));
+ assert.ok(/"-rotate" "0"/.test(cmd));
+ finish(err);
+ });
+
});
}

0 comments on commit b7c35ab

Please sign in to comment.