Get EXIF from image files using JavaScript
When you Google search for methods to get geolocation information (EXIF) from image files, exif-js
often appears at the top.
However, when using exif-js
, the following error message may sometimes appear.
ReferenceError: n is not defined
https://github.com/exif-js/exif-js/issues/120
@mmase This happens when you use strict mode. It's been there since JS v5 (2009, thanks to Douglas Crockford :)). In strict mode you can not tnot declare a new variable without an explicit var. Probably some other bit of JavaScript has a "use strict"; in it, and then you use exif.Plenty of other people have complained about this. But there are some other for loops that also don't have var yet. But I'll check the pull request.
It seems to occur if even one JavaScript file uses strict mode
.
Therefore, exif-js
cannot be used in development environments such as React.
Development of exif-js
stopped in 2017, and there is no prospect of this bug being fixed.
Let's use alternative libraries like exifr
.