Compare commits

...

4 Commits

Author SHA1 Message Date
zsviczian
0aa2608799
Update blob.ts 2025-02-04 21:12:18 +01:00
zsviczian
2e876e98d7
Update App.tsx 2025-02-04 21:11:29 +01:00
zsviczian
413f852cf6
lint 2025-02-04 20:14:31 +01:00
zsviczian
021f6d37d4
Fixes SAMSUNG update issue where blob.type === "" when adding image from gallery 2025-02-04 20:07:47 +01:00

View File

@ -9817,13 +9817,23 @@ class App extends React.Component<AppProps, AppState> {
this.state,
);
const imageFile = await fileOpen({
let imageFile = await fileOpen({
description: "Image",
extensions: Object.keys(
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({
sceneX: x,
sceneY: y,