Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

334
Views
How do I import tiff.js to my Vue project?

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)"

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I think your problem is addressed in this StackOverflow question if you want to import the js file in your Vue component Importing javascript file for use within vue component

or your other options could be https://github.com/photopea/UTIF.js or https://github.com/image-js/tiff

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!