Modified geometry() as discussed on #332.

Made it only accept a custom geometry command if the number of arguments is strictly one.
master
jdiez17 10 years ago
parent e3ee151c03
commit 76acacb769
  1. 6
      lib/args.js

@ -255,9 +255,9 @@ module.exports = function (proto) {
// http://www.graphicsmagick.org/GraphicsMagick.html#details-geometry
proto.geometry = function geometry (width, height, arg) {
// If the first argument is a string, this is a custom geometry command.
if(typeof width === "string")
return this.out("-geometry", width);
// If the first argument is a string, and there is only one argument, this is a custom geometry command.
if(arguments.length == 1 && typeof arguments[0] === "string")
return this.out("-geometry", arguments[0]);
// Otherwise, return a resizing geometry command with an option alrgument.
return this.out("-geometry", width+'x'+height+(arg||''));

Loading…
Cancel
Save