Loading src/jp4-canvas/elphel.js +8 −3 Original line number Original line Diff line number Diff line Loading @@ -87,10 +87,15 @@ var Elphel = { sctx.canvas.width = w; sctx.canvas.width = w; sctx.canvas.height = h; sctx.canvas.height = h; cscale = Math.round(w/tw*100)/100; //cscale = Math.round(w/tw*100)/100; sctx.scale(cscale,cscale); //option 1 sctx.drawImage(cnv_src[0],0,0); //cscale = w/tw; //sctx.scale(cscale,cscale); //sctx.drawImage(cnv_src[0],0,0); // option 2 sctx.drawImage(cnv_src[0],0,0,ctx.canvas.width,ctx.canvas.height,0,0,sctx.canvas.width,sctx.canvas.height); console.log("drawScaled(): "+(Date.now()-t0)/1000+" s"); console.log("drawScaled(): "+(Date.now()-t0)/1000+" s"); } } Loading src/jp4-canvas/get-image.php +6 −1 Original line number Original line Diff line number Diff line Loading @@ -30,13 +30,18 @@ if (isset($_GET['rel'])) else else die(); die(); if (isset($_GET['ip'])) $ip = $_GET['ip']; else $ip = "localhost"; /* /* header("Location: http://{$_SERVER['HTTP_HOST']}:$port/$rel"); header("Location: http://{$_SERVER['HTTP_HOST']}:$port/$rel"); die(); die(); */ */ header('Content-type:image/jpeg'); header('Content-type:image/jpeg'); echo file_get_contents("http://localhost:$port/$rel"); echo file_get_contents("http://$ip:$port/$rel"); die(); die(); Loading Loading
src/jp4-canvas/elphel.js +8 −3 Original line number Original line Diff line number Diff line Loading @@ -87,10 +87,15 @@ var Elphel = { sctx.canvas.width = w; sctx.canvas.width = w; sctx.canvas.height = h; sctx.canvas.height = h; cscale = Math.round(w/tw*100)/100; //cscale = Math.round(w/tw*100)/100; sctx.scale(cscale,cscale); //option 1 sctx.drawImage(cnv_src[0],0,0); //cscale = w/tw; //sctx.scale(cscale,cscale); //sctx.drawImage(cnv_src[0],0,0); // option 2 sctx.drawImage(cnv_src[0],0,0,ctx.canvas.width,ctx.canvas.height,0,0,sctx.canvas.width,sctx.canvas.height); console.log("drawScaled(): "+(Date.now()-t0)/1000+" s"); console.log("drawScaled(): "+(Date.now()-t0)/1000+" s"); } } Loading
src/jp4-canvas/get-image.php +6 −1 Original line number Original line Diff line number Diff line Loading @@ -30,13 +30,18 @@ if (isset($_GET['rel'])) else else die(); die(); if (isset($_GET['ip'])) $ip = $_GET['ip']; else $ip = "localhost"; /* /* header("Location: http://{$_SERVER['HTTP_HOST']}:$port/$rel"); header("Location: http://{$_SERVER['HTTP_HOST']}:$port/$rel"); die(); die(); */ */ header('Content-type:image/jpeg'); header('Content-type:image/jpeg'); echo file_get_contents("http://localhost:$port/$rel"); echo file_get_contents("http://$ip:$port/$rel"); die(); die(); Loading