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
58567ad0
Commit
58567ad0
authored
Apr 01, 2019
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pass Content-Type (image/jpeg,image/jp4, image/tiff) instead of hardcoded image/jpeg
parent
7e99843a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
get-image.php
src/jp4-canvas/get-image.php
+19
-3
No files found.
src/jp4-canvas/get-image.php
View file @
58567ad0
...
...
@@ -44,10 +44,26 @@ $port0 = 2323;
$pointers
=
elphel_get_circbuf_pointers
(
intval
(
$port
)
-
$port0
,
1
);
$pointer
=
$pointers
[
count
(
$pointers
)
-
1
][
'circbuf_pointer'
];
$contents
=
file_get_contents
(
"http://
$ip
:
$port
/
$rel
"
);
$acao
=
"*"
;
$ct
=
"image/jpeg"
;
// pass some headers from file_get_contents
// $http_response_header is auto populated
foreach
(
$http_response_header
as
$h
){
$hv
=
explode
(
":"
,
$h
);
if
(
$hv
[
0
]
==
"Access-Control-Allow-Origin"
){
$acao
=
trim
(
$hv
[
1
]);
}
else
if
(
$hv
[
0
]
==
"Content-Type"
){
$ct
=
trim
(
$hv
[
1
]);
}
}
// allow CORS
header
(
'Access-Control-Allow-Origin: *'
);
header
(
'Content-type:image/jpeg'
);
echo
file_get_contents
(
"http://
$ip
:
$port
/
$pointer
/
$rel
"
)
;
header
(
"Access-Control-Allow-Origin:
$acao
"
);
header
(
"Content-Type:
$ct
"
);
echo
$contents
;
//echo file_get_contents("http://$ip:$port/$rel");
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