From 40dba40a52c8132458b7d50f3ca2b57826c3e788 Mon Sep 17 00:00:00 2001 From: Sead Feng Date: Tue, 27 Aug 2024 15:00:54 +0800 Subject: [PATCH] fix getBase64MimeType --- src/lib/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 3a9ecad..856b95b 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -199,7 +199,7 @@ export const getImageMimeType = (contentType: string) => { return imgType; } export const getBase64MimeType = (base64Data: string): string => { - const mimeTypeMatch = base64Data.match(/^data:(image\/[\w+]+);base64,/); + const mimeTypeMatch = base64Data.match(/^data:(image\/.*?);base64,/); if (mimeTypeMatch && mimeTypeMatch[1]) { return getImageMimeType(mimeTypeMatch[1])