mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Merge 0aa2608799
into 2a0d15799c
This commit is contained in:
commit
e9538f95df
1 changed files with 11 additions and 1 deletions
|
@ -10004,13 +10004,23 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
this.state,
|
this.state,
|
||||||
);
|
);
|
||||||
|
|
||||||
const imageFile = await fileOpen({
|
let imageFile = await fileOpen({
|
||||||
description: "Image",
|
description: "Image",
|
||||||
extensions: Object.keys(
|
extensions: Object.keys(
|
||||||
IMAGE_MIME_TYPES,
|
IMAGE_MIME_TYPES,
|
||||||
) as (keyof typeof IMAGE_MIME_TYPES)[],
|
) as (keyof typeof IMAGE_MIME_TYPES)[],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//maybe temporary fix: https://github.com/excalidraw/excalidraw/issues/9091
|
||||||
|
if (imageFile && !imageFile.type) {
|
||||||
|
const extension = imageFile.name.split(".").pop()?.toLowerCase();
|
||||||
|
const mimeType =
|
||||||
|
IMAGE_MIME_TYPES[extension as keyof typeof IMAGE_MIME_TYPES];
|
||||||
|
if (mimeType) {
|
||||||
|
imageFile = new File([imageFile], imageFile.name, { type: mimeType });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const imageElement = this.createImageElement({
|
const imageElement = this.createImageElement({
|
||||||
sceneX: x,
|
sceneX: x,
|
||||||
sceneY: y,
|
sceneY: y,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue