Skip to content

Commit

Permalink
Pass croppedCanvasOptions to getCroppedCanvas (#3320)
Browse files Browse the repository at this point in the history
  • Loading branch information
boudra committed Nov 16, 2021
1 parent 4e4eddf commit 335e0df
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 0 additions & 11 deletions packages/@uppy/image-editor/src/Editor.js
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/image-editor/src/index.js
Expand Up @@ -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,
Expand Down

0 comments on commit 335e0df

Please sign in to comment.