瀏覽代碼

Pass croppedCanvasOptions to getCroppedCanvas (#3320)

Mohamed Boudra 3 年之前
父節點
當前提交
335e0dffd4
共有 2 個文件被更改,包括 1 次插入12 次删除
  1. 0 11
      packages/@uppy/image-editor/src/Editor.js
  2. 1 1
      packages/@uppy/image-editor/src/index.js

+ 0 - 11
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

+ 1 - 1
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,