Commit 88e2352a authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

changes for TIFF files (synced to rocko)

parent 4f2579ba
......@@ -227,27 +227,20 @@
this.getFormat = () => this.format;
this.getSrc = () => settings.src;
function process_image_tiff(blob){
function process_image_tiff(imagedata){
IMAGE_FORMAT = "TIFF";
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
//var tiff = new Tiff({buffer: arrayBuffer});
//var canvas = tiff.toCanvas();
// UTIF.js
var ifds = UTIF.decode(arrayBuffer);
UTIF.decodeImage(arrayBuffer, ifds[0]);
var ifds = UTIF.decode(imagedata);
UTIF.decodeImage(imagedata, ifds[0]);
if (ifds[0].t258==16){
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));
......@@ -354,15 +347,9 @@
var ctx = canvas.getContext('2d');
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);
}
fileReader.readAsArrayBuffer(blob);
conclude_processing();
}
function process_image(imagedata){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment