diff --git a/dist/image-editor.js b/dist/image-editor.js index e7cc55a..3780c88 100644 --- a/dist/image-editor.js +++ b/dist/image-editor.js @@ -1337,7 +1337,9 @@ function ImageEditor(canvasId, args) { * @param {string} unit cm|inch * @return {ImageEditor} */ - this.crop = function (width, height, unit) { + this.crop = function (width, height, unit, removeTransparency) { + removeTransparency = typeof removeTransparency !== 'undefined' ? removeTransparency : false; + if (!width || !height) { return this; } @@ -1354,6 +1356,10 @@ function ImageEditor(canvasId, args) { _canvas.getImage().__cropped = false; } + if (removeTransparency) { + _canvas.getApertures().setTransparent(false); + } + return this; }; diff --git a/src/ImageEditor.js b/src/ImageEditor.js index 4c9de89..8ec25d4 100644 --- a/src/ImageEditor.js +++ b/src/ImageEditor.js @@ -99,7 +99,9 @@ function ImageEditor(canvasId, args) { * @param {string} unit cm|inch * @return {ImageEditor} */ - this.crop = function (width, height, unit) { + this.crop = function (width, height, unit, removeTransparency) { + removeTransparency = typeof removeTransparency !== 'undefined' ? removeTransparency : false; + if (!width || !height) { return this; } @@ -116,6 +118,10 @@ function ImageEditor(canvasId, args) { _canvas.getImage().__cropped = false; } + if (removeTransparency) { + _canvas.getApertures().setTransparent(false); + } + return this; };