Skip to content

Commit

Permalink
fix getBase64MimeType
Browse files Browse the repository at this point in the history
  • Loading branch information
seadfeng committed Aug 27, 2024
1 parent 86a30fc commit 40dba40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 40dba40

Please sign in to comment.