I am using vue in a rails application and am trying to import the exif-js library into my script in order to access the global EXIF variable to use as such
var exif = EXIF.readFromBinaryFile(new BinaryFile(this.result));
I have downloaded the package by following these yarn instruction.
yarn add exif-js -- save
I realize I need to use the javascript import to include it into my scripts and have tried
<script>
import EXIF from 'exif-js'
previewPhoto() {
var reader = new FileReader()
reader.onload = () => {
var exif = EXIF.readFromBinaryFile(new BinaryFile(this.result));
}
</script>
and other variances such as import 'exif-js'
, however I keep getting Uncaught ReferenceError: EXIF is not defined
error. How do I successfully import the library so that I can use it in my scripts.