From 335e0dffd4b71c04786ae46daa9def10f9985631 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Tue, 16 Nov 2021 11:42:33 +0100 Subject: [PATCH] Pass croppedCanvasOptions to getCroppedCanvas (#3320) --- packages/@uppy/image-editor/src/Editor.js | 11 ----------- packages/@uppy/image-editor/src/index.js | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/packages/@uppy/image-editor/src/Editor.js b/packages/@uppy/image-editor/src/Editor.js index 22e56e3b19..f90daa47d5 100644 --- a/packages/@uppy/image-editor/src/Editor.js +++ b/packages/@uppy/image-editor/src/Editor.js @@ -35,17 +35,6 @@ module.exports = class Editor extends Component { this.cropper.destroy() } - save = () => { - const { opts, save, currentImage } = this.props - - this.cropper.getCroppedCanvas(opts.cropperOptions.croppedCanvasOptions) - .toBlob( - (blob) => save(blob), - currentImage.type, - opts.quality, - ) - } - granularRotateOnChange = (ev) => { const { rotationAngle, rotationDelta } = this.state const pendingRotationDelta = Number(ev.target.value) - rotationDelta diff --git a/packages/@uppy/image-editor/src/index.js b/packages/@uppy/image-editor/src/index.js index e2abf74f23..c01f34c2ef 100644 --- a/packages/@uppy/image-editor/src/index.js +++ b/packages/@uppy/image-editor/src/index.js @@ -91,7 +91,7 @@ module.exports = class ImageEditor extends UIPlugin { const { currentImage } = this.getPluginState() - this.cropper.getCroppedCanvas().toBlob( + this.cropper.getCroppedCanvas(this.opts.cropperOptions.croppedCanvasOptions).toBlob( saveBlobCallback, currentImage.type, this.opts.quality,