From 2ea02051a183b82767968f1ca60d2c18133c77a8 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:53:07 +0900 Subject: [PATCH] fix --- packages/frontend/src/scripts/watermark.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/scripts/watermark.ts b/packages/frontend/src/scripts/watermark.ts index 2b910d3617..04b1f4098f 100644 --- a/packages/frontend/src/scripts/watermark.ts +++ b/packages/frontend/src/scripts/watermark.ts @@ -124,7 +124,7 @@ export function applyWatermark(img: string | Blob, el: HTMLCanvasElement | Offsc ctx.drawImage(imgEl, 0, 0); if (config != null) { - if (config.fileUrl) { + if (config.fileUrl != null || config.fileId != null) { const watermark = new Image(); watermark.onload = () => { const canvasAspectRatio = canvas.width / canvas.height; // 横長は1より大きい @@ -247,8 +247,12 @@ export function applyWatermark(img: string | Blob, el: HTMLCanvasElement | Offsc watermarkUrl = config.fileUrl!; } - watermark.src = config.__bypassMediaProxy ? config.fileUrl : getProxiedImageUrl(watermarkUrl, undefined, true); + watermark.src = config.__bypassMediaProxy ? watermarkUrl : getProxiedImageUrl(watermarkUrl, undefined, true); + } else { + resolve(); } + } else { + resolve(); } };