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 = {
sctx.canvas.width = w;
sctx.canvas.height = h;
cscale = Math.round(w/tw*100)/100;
//cscale = Math.round(w/tw*100)/100;
sctx.scale(cscale,cscale);
sctx.drawImage(cnv_src[0],0,0);
//option 1
//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");
}
......
......@@ -30,13 +30,18 @@ if (isset($_GET['rel']))
else
die();
if (isset($_GET['ip']))
$ip = $_GET['ip'];
else
$ip = "localhost";
/*
header("Location: http://{$_SERVER['HTTP_HOST']}:$port/$rel");
die();
*/
header('Content-type:image/jpeg');
echo file_get_contents("http://localhost:$port/$rel");
echo file_get_contents("http://$ip:$port/$rel");
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