Quiero ver el archivo .tif en mi Vue, así que trato de usar tiff.js.
Lo pruebo en un "test.html" y lo uso para importar tiff.min.js.
<script src="./tiff.min.js"> </script>Sin embargo, no hay exportación desde tiff.min.js, así que no sé cómo importar eso a mi 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>hay algo mal: "No se pudo encontrar el nombre 'Tiff'. ¿Quiso decir 'tiff'? Vetur(2570)"
Creo que su problema se aborda en esta pregunta de StackOverflow si desea importar el archivo js en su componente Vue Importar archivo javascript para usar dentro del componente vue
o sus otras opciones podrían ser https://github.com/photopea/UTIF.js o https://github.com/image-js/tiff