aboutsummaryrefslogtreecommitdiff
path: root/src/workers/image.worker.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-08-14 13:02:53 -0400
committerbobzel <zzzman@gmail.com>2025-08-14 13:02:53 -0400
commitcabd82bea8eb4c69f60c8b5d4f987cf484123ecd (patch)
tree00430ea11b9eaa0dc032a8f7941849bbb9e0bf44 /src/workers/image.worker.ts
parent467f1c2543626a50d48c84669cd408571260f147 (diff)
moved background removal code into ImageUtils
Diffstat (limited to 'src/workers/image.worker.ts')
-rw-r--r--src/workers/image.worker.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/workers/image.worker.ts b/src/workers/image.worker.ts
index d069742f3..c6db44d03 100644
--- a/src/workers/image.worker.ts
+++ b/src/workers/image.worker.ts
@@ -1,16 +1,17 @@
import { removeBackground } from '@imgly/background-removal';
self.onmessage = async (event: MessageEvent) => {
- const { imagePath, doc, addDoc } = event.data;
+ const { imagePath, options, nativeWidth, nativeHeight, docId } = event.data;
try {
// Perform the background removal
const result = await removeBackground(imagePath);
// Send the result back to the main thread
- self.postMessage({ success: true, result, doc, addDoc });
+ self.postMessage({ success: true, result, options, nativeWidth, nativeHeight, docId });
} catch (error) {
// Send the error back to the main thread
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
self.postMessage({ success: false, error: (error as any).message });
}
};