Commit c24f15cc authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

1. fixed scale 2. + get image by ip as well

parent 301cc4bc
...@@ -87,10 +87,15 @@ var Elphel = { ...@@ -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");
} }
......
...@@ -30,13 +30,18 @@ if (isset($_GET['rel'])) ...@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment