|
|
@ -789,7 +789,7 @@ module.exports = function (proto) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// http://www.graphicsmagick.org/GraphicsMagick.html#details-crop
|
|
|
|
// http://www.graphicsmagick.org/GraphicsMagick.html#details-crop
|
|
|
|
proto.crop = function crop (w, h, x, y, percent) { |
|
|
|
proto.crop = function crop (w, h, x, y, arg) { |
|
|
|
if (this.inputIs('jpg')) { |
|
|
|
if (this.inputIs('jpg')) { |
|
|
|
// avoid error "geometry does not contain image (unable to crop image)" - gh-17
|
|
|
|
// avoid error "geometry does not contain image (unable to crop image)" - gh-17
|
|
|
|
var index = this._in.indexOf('-size'); |
|
|
|
var index = this._in.indexOf('-size'); |
|
|
@ -798,7 +798,10 @@ module.exports = function (proto) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return this.out("-crop", w + "x" + h + "+" + (x || 0) + "+" + (y || 0) + (percent ? '%' : '')); |
|
|
|
// backward compatibility
|
|
|
|
|
|
|
|
arg = (arg === true) ? '%' : arg; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return this.out("-crop", w + "x" + h + "+" + (x || 0) + "+" + (y || 0) + (arg || '')); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// http://www.graphicsmagick.org/GraphicsMagick.html#details-magnify
|
|
|
|
// http://www.graphicsmagick.org/GraphicsMagick.html#details-magnify
|
|
|
|