mirror of
https://github.com/infrost/RaptorQR.git
synced 2026-09-05 01:17:48 +08:00
Fix receiver: stale closure + add GIF file test mode
- Fix stale closure bug in camera capture loop (scanning state captured as false, preventing any frame capture) - Add GIF File input mode to receiver — upload a QR-over-GIF directly to test the decode pipeline without camera - Update decode worker to accept imageData or frameData - Receiver now shows two input modes: Camera and GIF File
This commit is contained in:
@@ -53,8 +53,10 @@ self.onmessage = (e: MessageEvent) => {
|
||||
}
|
||||
|
||||
if (msg.type === 'frame') {
|
||||
const imageData: ImageData = msg.imageData ?? msg.frameData;
|
||||
if (!imageData) return;
|
||||
try {
|
||||
handleFrame(msg.imageData as ImageData);
|
||||
handleFrame(imageData);
|
||||
} catch (err: any) {
|
||||
// Don't crash worker on decode errors
|
||||
self.postMessage({ type: 'error', message: err.message ?? String(err) });
|
||||
|
||||
Reference in New Issue
Block a user