I want to view the .tif file in my Vue, so I try to use the tiff.js.
I try it in a "test.html" and use this to import the tiff.min.js.
<script src="./tiff.min.js">
</script>
However, there is no export from tiff.min.js so I don't know how to import that to my vue-cli.
<script>
export default ({
name:"test",
methods:{
show(file){
var reader = new FileReader();
reader.onload = (function (theFile) {
return function (e) {
var buffer = e.target.result;
var tiff = new Tiff({buffer: buffer});
var canvas = tiff.toCanvas();
var width = tiff.width();
var height = tiff.height();
if (canvas) {
$('#output').empty().append(canvas);
}
};
})(file);
reader.readAsArrayBuffer(file);
}
}
})
</script>
there is something wrong:"Could not find name 'Tiff'. Did you mean 'tiff'?Vetur(2570)"