I have a requirement to load a TIFF file using JQuery and Javascript.
I use the following code to load a 3-channel PNG file.
(function(file){
var reader = new FileReader();
$(reader).load(function(e){
var img = new Image();
$(img).load(function(){
$('#im-' + idx.toString()).attr('src', this.src);
}
})reader.readAsDataURL(file);
})(this.files[0]);
This code is not able to load the TIFF file which has 21 channels. Could anyone suggest a way to do this?
<img>
sources in the first place?reader
a jQuery object? It's not a DOM element. You don't need jQuery at all to read an image file, there's 0 DOM element involved.