Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

editor: export blob as b64 with correct content type

ammarahm-edf9b886535142
diff --git a/packages/editor/src/utils/downloader.ts b/packages/editor/src/utils/downloader.ts
index 7891e1d36..b65f8f6ad 100644
--- a/packages/editor/src/utils/downloader.ts
+++ b/packages/editor/src/utils/downloader.ts
@@ -72,7 +72,11 @@ export async function downloadImage(url: string, options?: DownloadOptions) {
throw new Error("not an image");
const size = parseInt(contentLength);
- const blob = await response.blob();
+ let blob = await response.blob();
+ if (UTITypes[blob.type])
+ blob = new Blob([blob], {
+ type: contentType
+ });
return {
blob,
url: URL.createObjectURL(blob),