From 9b99be4c1d52b6f198f233a75c2adb7a1ece8c36 Mon Sep 17 00:00:00 2001 From: patriceac <48073125+patriceac@users.noreply.github.com> Date: Wed, 22 Feb 2023 00:06:07 -0800 Subject: [PATCH] Allow modifiers to be passed as base64 images No change in existing UI behavior, this change allows image modifier plugins to (optionally) pass the card image as a base64-encoded image rather than a source file. --- ui/media/js/image-modifiers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/media/js/image-modifiers.js b/ui/media/js/image-modifiers.js index c28a5872..2b946aa8 100644 --- a/ui/media/js/image-modifiers.js +++ b/ui/media/js/image-modifiers.js @@ -80,7 +80,7 @@ function createModifierGroup(modifierGroup, initiallyExpanded, removeBy) { modifiers.forEach(modObj => { const modifierName = modObj.modifier - const modifierPreviews = modObj?.previews?.map(preview => `${modifierThumbnailPath}/${preview.path}`) + const modifierPreviews = modObj?.previews?.map(preview => `${IMAGE_REGEX.test(preview.image) ? preview.image : modifierThumbnailPath + '/' + preview.path}`) const modifierCard = createModifierCard(modifierName, modifierPreviews, removeBy)