1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Merge pull request #22613 from erasta:patch-1

Opencv.js: on imread add willReadFrequently to getContext
This commit is contained in:
Alexander Smorkalov
2022-10-11 09:42:55 +03:00
committed by GitHub
+1 -1
View File
@@ -55,7 +55,7 @@ Module['imread'] = function(imageSource) {
canvas = document.createElement('canvas');
canvas.width = img.width;
canvas.height = img.height;
ctx = canvas.getContext('2d');
ctx = canvas.getContext('2d', { willReadFrequently: true });
ctx.drawImage(img, 0, 0, img.width, img.height);
} else if (img instanceof HTMLCanvasElement) {
canvas = img;