From 6aeff5185793c0630e5b8b0a7e6534da7f7bc858 Mon Sep 17 00:00:00 2001 From: john Date: Wed, 28 May 2025 22:35:20 +0200 Subject: [PATCH] ignore resist fingerprinting error when resizing image TODO find another way --- src/components/NewPostWidget.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/NewPostWidget.tsx b/src/components/NewPostWidget.tsx index 7146bc7..ea3496a 100644 --- a/src/components/NewPostWidget.tsx +++ b/src/components/NewPostWidget.tsx @@ -196,7 +196,15 @@ async function optimizeImageSize( dstCanvas.width = width dstCanvas.height = height - await pica.resize(srcCanvas, dstCanvas) + try { + // TODO resistFingerprinting in FF and other causes this to break. + // knowing this, i would still rather be able to post from other browsers for now + // and will hopefully find a better solution + await pica.resize(srcCanvas, dstCanvas) + } catch (e) { + console.error('cant resize image', e) + return file + } let blob = await pica.toBlob(dstCanvas, outputType, quality)