Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed; rotation by 0

closes #90
  • Loading branch information...
commit b7c35ab2db0bfba0014b3c567916d651dce1d989 1 parent 8fcf3f8
@aheckmann authored
Showing with 14 additions and 3 deletions.
  1. +1 −1  lib/args.js
  2. +13 −2 test/rotate.js
View
2  lib/args.js
@@ -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
15 test/rotate.js
@@ -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);
+ });
+
});
}
Please sign in to comment.
Something went wrong with that request. Please try again.