1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #23451 from Zero2key:4.x

add opencv.js imread function can use OffscreenCanvas
This commit is contained in:
Alexander Smorkalov
2023-04-04 11:05:53 +03:00
committed by GitHub
+1 -1
View File
@@ -57,7 +57,7 @@ Module['imread'] = function(imageSource) {
canvas.height = img.height;
ctx = canvas.getContext('2d', { willReadFrequently: true });
ctx.drawImage(img, 0, 0, img.width, img.height);
} else if (img instanceof HTMLCanvasElement) {
} else if (img instanceof HTMLCanvasElement || img instanceof OffscreenCanvas) {
canvas = img;
ctx = canvas.getContext('2d');
} else {