Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-tools-x393
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-tools-x393
Commits
8d4e360d
Commit
8d4e360d
authored
Feb 13, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor
parent
3b908324
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
extract_images.php
extract_images.php
+23
-14
No files found.
extract_images.php
View file @
8d4e360d
...
@@ -136,7 +136,7 @@ function split_file($path,$file,$destination){
...
@@ -136,7 +136,7 @@ function split_file($path,$file,$destination){
global
$input_exts
;
global
$input_exts
;
if
(
in_array
(
get_ext
(
"
$path
/
$file
"
),
$input_exts
))
{
if
(
in_array
(
get_ext
(
"
$path
/
$file
"
),
$input_exts
))
{
echo
"Splitting
$path
/
$file
\n
"
;
echo
"Splitting
$path
/
$file
, results dir:
$path
/
$destination
\n
"
;
//split_mov("$path",$file,$destination,$extension,$startMarkerWithExif,$chunksize);
//split_mov("$path",$file,$destination,$extension,$startMarkerWithExif,$chunksize);
$markers
=
array
();
$markers
=
array
();
...
@@ -185,9 +185,11 @@ function split_file($path,$file,$destination){
...
@@ -185,9 +185,11 @@ function split_file($path,$file,$destination){
function
elphel_specific_result_name
(
$file
){
function
elphel_specific_result_name
(
$file
){
global
$forced_ext
;
$exif
=
exif_read_data
(
$file
);
$exif
=
exif_read_data
(
$file
);
$ext
=
elphel_specific_result_ext
(
$exif
);
$ext
=
elphel_specific_result_ext
(
$exif
,
$forced_ext
);
//converting GMT a local time GMT+7
//converting GMT a local time GMT+7
$timestamp_local
=
strtotime
(
$exif
[
'DateTimeOriginal'
]);
/*-25200;*/
$timestamp_local
=
strtotime
(
$exif
[
'DateTimeOriginal'
]);
/*-25200;*/
...
@@ -196,15 +198,22 @@ function elphel_specific_result_name($file){
...
@@ -196,15 +198,22 @@ function elphel_specific_result_name($file){
$tmp
=
explode
(
"_"
,
$exif
[
'Model'
]);
$tmp
=
explode
(
"_"
,
$exif
[
'Model'
]);
if
(
count
(
$tmp
)
==
2
){
if
(
count
(
$tmp
)
==
2
){
$model
=
intval
(
trim
(
$tmp
[
1
]));
$chn
=
intval
(
$exif
[
'PageNumber'
])
+
1
;
if
(
trim
(
$tmp
[
0
])
==
"Eyesis4pi393"
){
if
(
$model
==
1001
)
{
$k
=
$chn
;
$model
=
intval
(
trim
(
$tmp
[
1
]));
}
else
if
(
$model
==
1002
)
{
$chn
=
intval
(
$exif
[
'PageNumber'
])
+
1
;
$k
=
$chn
+
4
;
}
else
if
(
$model
==
1003
)
{
if
(
$model
==
1001
)
{
$k
=
$chn
+
6
;
$k
=
$chn
;
}
else
if
(
$model
==
1002
)
{
$k
=
$chn
+
4
;
}
else
if
(
$model
==
1003
)
{
$k
=
$chn
+
6
;
}
}
}
}
else
{
}
else
{
$k
=
intval
(
$exif
[
'PageNumber'
])
+
1
;
$k
=
intval
(
$exif
[
'PageNumber'
])
+
1
;
}
}
...
@@ -220,21 +229,21 @@ function get_ext($filename) {
...
@@ -220,21 +229,21 @@ function get_ext($filename) {
/**
/**
* read image format and return extension, elphel elphel_specific
* read image format and return extension, elphel elphel_specific
* @param array $exif Array returned from the PHP's built-in exif_read_data function
* @param array $exif Array returned from the PHP's built-in exif_read_data function
* @param string $override_ext
* @return string extension - jpeg or jp4
* @return string extension - jpeg or jp4
*/
*/
function
elphel_specific_result_ext
(
$exif
){
function
elphel_specific_result_ext
(
$exif
,
$override_ext
=
""
){
global
$forced_ext
;
//default value
//default value
$ext
=
"jpeg"
;
$ext
=
"jpeg"
;
if
(
$
forced
_ext
==
""
){
if
(
$
override
_ext
==
""
){
if
(
isset
(
$exif
[
'MakerNote'
][
10
])){
if
(
isset
(
$exif
[
'MakerNote'
][
10
])){
$record
=
(
$exif
[
'MakerNote'
][
10
]
>>
4
)
&
0xf
;
$record
=
(
$exif
[
'MakerNote'
][
10
]
>>
4
)
&
0xf
;
if
(
$record
==
5
)
$ext
=
"jp4"
;
if
(
$record
==
5
)
$ext
=
"jp4"
;
}
}
}
else
{
}
else
{
$ext
=
$
forced
_ext
;
$ext
=
$
override
_ext
;
}
}
return
$ext
;
return
$ext
;
}
}
...
...
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