MCPcopy Index your code
hub / github.com/mailru/FileAPI / toCanvas

Function toCanvas

tests/tests.js:53–67  ·  view source on GitHub ↗
(img)

Source from the content-addressed store, hash-verified

51
52
53 function toCanvas(img){
54 var canvas = document.createElement('canvas');
55 if( img ){
56 canvas.width = img.width || img.videoWidth;
57 canvas.height = img.height || img.videoHeight;
58 var ctx = canvas.getContext('2d');
59 try {
60 ctx.drawImage(img, 0, 0);
61 } catch (err){
62 console.log(err.toString());
63 console.log(err.stack);
64 }
65 }
66 return canvas;
67 }
68
69
70 function imageEqual(left, right, text, callback, delta){

Callers 1

imageEqualFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected