Commit c24f15cc authored by Oleg Dzhimiev's avatar Oleg Dzhimiev
Browse files

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

parent 301cc4bc
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -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");
    }
    }
+6 −1
Original line number Original line Diff line number Diff line
@@ -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();