This is the JavaScript code I use to load files from an input element. Image format includes jpeg, png, tiff.
$(document).ready(function() {
FileDetails = function() {
var input = document.getElementById('fileUpload');
var output = document.getElementById('tblUpload');
//' + (URL || webkitURL).createObjectURL(input.files[i]) +'
output.innerHTML = '<tr>';
output.innerHTML += '<th class="thStyle" style="width: 400px;"><b>File Name</b></th><th class="thStyle" style="width: 150px;"><b>Preview Image</b></th>';
for (var i = 0; i < input.files.length; ++i) {
output.innerHTML += '<td style="padding: 10px; width: 400px;">' +
input.files[i].name + '</td>' +
'<td style="padding: 10px; width: 150px; color: #0d47a1">' +
'<a target="_blank" href="' + (URL || webkitURL).createObjectURL(input.files[i]) + '">Show</a></td>';
}
output.innerHTML += '</tr>';
}
});
Now, how can I use the seikichi/tiff library to display tiff files?
I have been testing all sort of picture formats but the tiff files format always asks to be downloaded. Others such as jpeg, png can be displayed.