Skip to content

Commit

Permalink
Image editor: make compressor work after the image editor, too (#4918)
Browse files Browse the repository at this point in the history
* Editor.tsx - clean up post typescriptofication

* dev - finally add favicons to avoid errors in the console

* ImageEditor.tsx - reinsert filename after image editor
  • Loading branch information
lakesare authored Feb 14, 2024
1 parent d85caf6 commit 3c0140a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/@uppy/image-editor/src/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
prevCropboxData,
)
if (newCropboxData) this.cropper.setCropBoxData(newCropboxData)
// When we stretch the cropbox by one of its sides
// 2. When we stretch the cropbox by one of its sides
} else {
const newCropboxData = limitCropboxMovementOnResize(
canvasData,
Expand Down Expand Up @@ -120,7 +120,7 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
}

onRotateGranular = (ev: ChangeEvent<HTMLInputElement>): void => {
// 1. Set state
// 1. Set state
const newGranularAngle = Number(ev.target.value)
this.setState({ angleGranular: newGranularAngle })

Expand Down
3 changes: 2 additions & 1 deletion packages/@uppy/image-editor/src/ImageEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ export default class ImageEditor<
const { currentImage } = this.getPluginState()

this.uppy.setFileState(currentImage!.id, {
data: blob!,
// Reinserting image's name and type, because .toBlob loses both.
data: new File([blob!], currentImage!.name, { type: blob!.type }),
size: blob!.size,
preview: undefined,
})
Expand Down
1 change: 1 addition & 0 deletions private/dev/dragdrop.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Drag-Drop</title>
<link rel="icon" type="image/png" href="https://uppy.io/img/logo.svg" />
</head>
<body>
<style>
Expand Down
1 change: 1 addition & 0 deletions private/dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Dashboard</title>
<link rel="icon" type="image/png" href="https://uppy.io/img/logo.svg" />
<style>
main {
padding-top: 100px;
Expand Down

0 comments on commit 3c0140a

Please sign in to comment.