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
2e327aa7
Commit
2e327aa7
authored
Aug 25, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+debug
parent
0a31e92d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
29 deletions
+49
-29
index.php
src/snapshot/index.php
+48
-28
snapshot.js
src/snapshot/snapshot.js
+1
-1
No files found.
src/snapshot/index.php
View file @
2e327aa7
...
...
@@ -72,33 +72,6 @@
}
// get exif data from all buffers in a single text file
if
(
isset
(
$_GET
[
'exifs'
])){
if
(
isset
(
$_GET
[
'sensor_port'
])){
$port
=
$_GET
[
'sensor_port'
];
}
else
{
$port
=
$lowest_port
;
}
$circbuf_pointers
=
elphel_get_circbuf_pointers
(
$port
,
1
);
// get metas
$meta
=
array
();
foreach
(
$circbuf_pointers
as
$k
=>
$v
){
$meta
[
$k
]
=
array
(
'circbuf_pointer'
=>
$v
[
'circbuf_pointer'
],
'meta'
=>
elphel_get_interframe_meta
(
$port
,
$v
[
'circbuf_pointer'
]),
'Exif'
=>
elphel_get_exif_elphel
(
$port
,
$v
[
'exif_pointer'
])
);
}
print_r
(
$meta
);
die
();
}
if
(
isset
(
$_GET
[
'zip'
])){
$contents
=
Array
();
...
...
@@ -107,7 +80,9 @@
foreach
(
$available_ports
as
$port
){
array_push
(
$rqs
,
"http://
{
$_SERVER
[
'SERVER_ADDR'
]
}
:
$port
/timestamp_name/bimg"
);
}
// '1' in the end - get response with headers
$cdata
=
curl_multi_start
(
$rqs
,
1
);
// '1' in the end - parse response with headers
$results
=
curl_multi_finish
(
$cdata
,
false
,
0
,
false
,
1
);
$filenames
=
$results
[
'names'
];
...
...
@@ -127,7 +102,7 @@
}
*/
$zipfilename
=
preg_replace
(
"/_\d+\.jp
4
$/"
,
".zip"
,
$filenames
[
0
]);
$zipfilename
=
preg_replace
(
"/_\d+\.jp
(4|.*g)
$/"
,
".zip"
,
$filenames
[
0
]);
//tmpfile
$tmpfile
=
tmpfile
();
...
...
@@ -143,6 +118,16 @@
$zip
->
addFromString
(
$v
,
$contents
[
$k
]);
}
if
(
isset
(
$_GET
[
'exifs'
])){
foreach
(
$available_ports
as
$k
=>
$v
){
$i
=
$v
-
$port0
;
$fname
=
$filenames
[
$k
];
$v_new
=
preg_replace
(
"/\.jp(4|.*g)$/"
,
"_exifs.txt"
,
$fname
);
$exifs
=
get_all_exifs
(
$i
);
$zip
->
addFromString
(
$v_new
,
var_export
(
$exifs
,
true
));
}
}
$zip
->
close
();
header
(
'Content-type: application/zip'
);
...
...
@@ -153,6 +138,41 @@
}
// get exif data from all buffers in a single text file
if
(
isset
(
$_GET
[
'exifs'
])){
if
(
isset
(
$_GET
[
'sensor_port'
])){
$port
=
$_GET
[
'sensor_port'
];
}
else
{
$port
=
$lowest_port
;
}
$meta
=
get_all_exifs
(
intval
(
$port
));
print_r
(
$meta
);
die
();
}
}
function
get_all_exifs
(
$port
){
$circbuf_pointers
=
elphel_get_circbuf_pointers
(
$port
,
1
);
// get metas
$meta
=
array
();
foreach
(
$circbuf_pointers
as
$k
=>
$v
){
$meta
[
$k
]
=
array
(
'circbuf_pointer'
=>
$v
[
'circbuf_pointer'
],
'meta'
=>
elphel_get_interframe_meta
(
$port
,
$v
[
'circbuf_pointer'
]),
'Exif'
=>
elphel_get_exif_elphel
(
$port
,
$v
[
'exif_pointer'
])
);
}
return
$meta
;
}
?>
...
...
src/snapshot/snapshot.js
View file @
2e327aa7
...
...
@@ -50,7 +50,7 @@ function download_all(rtp){
// get ze blob
var
http
=
new
XMLHttpRequest
();
http
.
open
(
"GET"
,
"?zip"
,
true
);
http
.
open
(
"GET"
,
"?zip"
+
(
dl_exif_histories
?
"&exifs"
:
""
)
,
true
);
http
.
responseType
=
"blob"
;
http
.
onload
=
function
(
e
){
...
...
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