fix occasional breakage in makeImageDataUrl

This commit is contained in:
or-else
2021-06-10 19:54:42 -07:00
parent c57fd6e539
commit 9b76577bb9
9 changed files with 290 additions and 292 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ export function theCard(fn, imageUrl, imageMimeType) {
card = card || {};
let mimeType = imageMimeType;
// Is this a data URL "data:[<mediatype>][;base64],<data>"?
const matches = /^data:(image\/[-a-z0-9+.]+)(;base64)?,/i.exec(imageUrl);
const matches = /^data:(image\/[-a-z0-9+.]+)?(;base64)?,/i.exec(imageUrl);
if (matches) {
mimeType = matches[1];
card.photo = {