Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion client/dive-common/use/stereo/frameSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export function imageElementToRgba(
const ctx = canvas.getContext('2d');
if (!ctx) throw new Error('Could not get 2d canvas context');
ctx.drawImage(img as CanvasImageSource, 0, 0, width, height);
return { ...ctx.getImageData(0, 0, width, height), width, height };
// ImageData's fields are prototype getters, which a spread would drop.
const { data } = ctx.getImageData(0, 0, width, height);
return { data, width, height };
}

/**
Expand Down
Loading