add willReadFrequently on imread in js

pull/22612/head
Eran Geva 3 years ago committed by GitHub
parent a3ebafbdeb
commit 68bd156a71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      modules/js/src/helpers.js

@ -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;

Loading…
Cancel
Save