Browse Source

fix: added normalization to images added with the image tool to prevent MIME-mismatches (#10018)

* fix: fixed a bug where a MIME-mismatch in an image would cause an error to update cache

* fix: fixed a bug where a MIME-mismatch in an image would cause an error to update cache

* normalize inside insertImages()

---------

Co-authored-by: Mårten Mossberg <marmo607@student.liu.se>
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
pull/9209/head
Mossberg 3 months ago committed by GitHub
parent
commit
91c7748c3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      packages/excalidraw/components/App.tsx

5
packages/excalidraw/components/App.tsx

@ -10461,7 +10461,10 @@ class App extends React.Component<AppProps, AppState> { @@ -10461,7 +10461,10 @@ class App extends React.Component<AppProps, AppState> {
const initialized = await Promise.all(
placeholders.map(async (placeholder, i) => {
try {
return await this.initializeImage(placeholder, imageFiles[i]);
return await this.initializeImage(
placeholder,
await normalizeFile(imageFiles[i]),
);
} catch (error: any) {
this.setState({
errorMessage: error.message || t("errors.imageInsertError"),

Loading…
Cancel
Save