Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-web-393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-web-393
Commits
c24f15cc
Commit
c24f15cc
authored
Apr 05, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. fixed scale 2. + get image by ip as well
parent
301cc4bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
elphel.js
src/jp4-canvas/elphel.js
+8
-3
get-image.php
src/jp4-canvas/get-image.php
+6
-1
No files found.
src/jp4-canvas/elphel.js
View file @
c24f15cc
...
@@ -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"
);
}
}
...
...
src/jp4-canvas/get-image.php
View file @
c24f15cc
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment