From 62932e964f1f9926468b42ee48366312536a63a1 Mon Sep 17 00:00:00 2001 From: Brent Ely Date: Sat, 18 Mar 2023 01:48:59 -0500 Subject: [PATCH] added check for `cover` is base64 --- src/gen-objects.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gen-objects.ts b/src/gen-objects.ts index f0c86d5c..2380a51e 100644 --- a/src/gen-objects.ts +++ b/src/gen-objects.ts @@ -542,6 +542,8 @@ export function addMediaDefinition (target: PresSlide, opt: MediaProps): void { throw new Error('addMedia() error: either `data` or `path` are required!') } else if (strData && !strData.toLowerCase().includes('base64,')) { throw new Error('addMedia() error: `data` value lacks a base64 header! Ex: \'video/mpeg;base64,NMP[...]\')') + } else if (strCover && !strCover.toLowerCase().includes('base64,')) { + throw new Error('addMedia() error: `cover` value lacks a base64 header! Ex: \'data:image/png;base64,iV[...]\')') } // Online Video: requires `link` if (strType === 'online' && !strLink) {