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
88e2352a
Commit
88e2352a
authored
May 20, 2020
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes for TIFF files (synced to rocko)
parent
4f2579ba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
101 deletions
+88
-101
jquery-jp4.js
src/jp4-canvas/jquery-jp4.js
+88
-101
No files found.
src/jp4-canvas/jquery-jp4.js
View file @
88e2352a
...
@@ -227,27 +227,20 @@
...
@@ -227,27 +227,20 @@
this
.
getFormat
=
()
=>
this
.
format
;
this
.
getFormat
=
()
=>
this
.
format
;
this
.
getSrc
=
()
=>
settings
.
src
;
this
.
getSrc
=
()
=>
settings
.
src
;
function
process_image_tiff
(
blob
){
function
process_image_tiff
(
imagedata
){
IMAGE_FORMAT
=
"TIFF"
;
IMAGE_FORMAT
=
"TIFF"
;
obj
.
format
=
IMAGE_FORMAT
;
obj
.
format
=
IMAGE_FORMAT
;
var
arrayBuffer
;
var
fileReader
=
new
FileReader
();
fileReader
.
onload
=
function
(
event
){
arrayBuffer
=
event
.
target
.
result
;
// tiff.js which is limited in capabilities
// tiff.js which is limited in capabilities
//var tiff = new Tiff({buffer: arrayBuffer});
//var tiff = new Tiff({buffer: arrayBuffer});
//var canvas = tiff.toCanvas();
//var canvas = tiff.toCanvas();
// UTIF.js
// UTIF.js
var
ifds
=
UTIF
.
decode
(
arrayBuffer
);
var
ifds
=
UTIF
.
decode
(
imagedata
);
UTIF
.
decodeImage
(
arrayBuffer
,
ifds
[
0
]);
UTIF
.
decodeImage
(
imagedata
,
ifds
[
0
]);
if
(
ifds
[
0
].
t258
==
16
){
if
(
ifds
[
0
].
t258
==
16
){
rgba_16bit
=
new
Float32Array
(
ifds
[
0
].
data
.
filter
((
x
,
i
)
=>
i
%
2
==
0
));
rgba_16bit
=
new
Float32Array
(
ifds
[
0
].
data
.
filter
((
x
,
i
)
=>
i
%
2
==
0
));
rgba_16bit
=
rgba_16bit
.
map
((
x
,
i
)
=>
x
+
(
ifds
[
0
].
data
[
2
*
i
+
1
]
<<
8
));
rgba_16bit
=
rgba_16bit
.
map
((
x
,
i
)
=>
x
+
(
ifds
[
0
].
data
[
2
*
i
+
1
]
<<
8
));
...
@@ -354,15 +347,9 @@
...
@@ -354,15 +347,9 @@
var
ctx
=
canvas
.
getContext
(
'2d'
);
var
ctx
=
canvas
.
getContext
(
'2d'
);
ctx
.
putImageData
(
rgba_idata
,
0
,
0
);
ctx
.
putImageData
(
rgba_idata
,
0
,
0
);
cnv_working
.
trigger
(
"canvas_ready"
);
obj
.
busy
=
false
;
//Elphel.Canvas.drawScaled($(canvas),cnv_display,settings.width);
Elphel
.
Canvas
.
drawScaled
(
cnv_working
,
cnv_display
,
settings
.
width
);
Elphel
.
Canvas
.
drawScaled
(
cnv_working
,
cnv_display
,
settings
.
width
);
}
conclude_processing
();
fileReader
.
readAsArrayBuffer
(
blob
);
}
}
function
process_image
(
imagedata
){
function
process_image
(
imagedata
){
...
...
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