Gathering detailed insights and metrics for @firestitch/exif-js
Gathering detailed insights and metrics for @firestitch/exif-js
Gathering detailed insights and metrics for @firestitch/exif-js
Gathering detailed insights and metrics for @firestitch/exif-js
JavaScript library for reading EXIF image metadata
npm install @firestitch/exif-js
Typescript
Module System
Node Version
NPM Version
73.7
Supply Chain
97.8
Quality
81.7
Maintenance
100
Vulnerability
100
License
JavaScript (64.94%)
HTML (35.06%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
4,931 Stars
79 Commits
1,279 Forks
113 Watchers
2 Branches
22 Contributors
Updated on Jul 12, 2025
Latest Version
2.3.0
Package Id
@firestitch/exif-js@2.3.0
Unpacked Size
1.36 MB
Size
1.18 MB
File Count
14
NPM Version
6.9.0
Node Version
10.16.3
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A JavaScript library for reading EXIF meta data from image files.
You can use it on images in the browser, either from an image or a file input element. Both EXIF and IPTC metadata are retrieved. This package can also be used in AMD or CommonJS environments.
Note: The EXIF standard applies only to .jpg
and .tiff
images. EXIF logic in this package is based on the EXIF standard v2.2 (JEITA CP-3451, included in this repo).
Install exif-js
through NPM:
npm install exif-js --save
Or Bower:
bower install exif-js --save
Then add a script
tag in your an HTML in the best position referencing your local file.
1<script src="vendors/exif-js/exif-js"></script>
You can also use a minified version hosted on jsDelivr
1<script src="https://cdn.jsdelivr.net/npm/exif-js"></script>
The package adds a global EXIF
variable (or AMD or CommonJS equivalent).
Start with calling the EXIF.getData
function. You pass it an image as a parameter:
<img src="image.jpg">
<input type="file">
element on your page.As a second parameter you specify a callback function. In the callback function you should use this
to access the image with the aforementioned metadata you can then use as you want.
That image now has an extra exifdata
property which is a Javascript object with the EXIF metadata. You can access it's properties to get data like the image caption, the date a photo was taken or it's orientation.
You can get all tages with EXIF.getTag
. Or get a single tag with EXIF.getTag
, where you specify the tag as the second parameter.
The tag names to use are listed in EXIF.Tags
in exif.js
.
Important: Note that you have to wait for the image to be completely loaded, before calling getData
or any other function. It will silently fail otherwise.
You can implement this wait, by running your exif-extracting logic on the window.onLoad
function. Or on an image's own onLoad
function.
For jQuery users please note that you can NOT (reliably) use jQuery's ready
event for this. Because it fires before images are loaded.
You could use $(window).load() instead of $(document.ready() (please note that `exif-js has NO dependency on jQuery or any other external library).
JavaScript:
1window.onload=getExif; 2 3function getExif() { 4 var img1 = document.getElementById("img1"); 5 EXIF.getData(img1, function() { 6 var make = EXIF.getTag(this, "Make"); 7 var model = EXIF.getTag(this, "Model"); 8 var makeAndModel = document.getElementById("makeAndModel"); 9 makeAndModel.innerHTML = `${make} ${model}`; 10 }); 11 12 var img2 = document.getElementById("img2"); 13 EXIF.getData(img2, function() { 14 var allMetaData = EXIF.getAllTags(this); 15 var allMetaDataSpan = document.getElementById("allMetaDataSpan"); 16 allMetaDataSpan.innerHTML = JSON.stringify(allMetaData, null, "\t"); 17 }); 18}
HTML:
1<img src="image1.jpg" id="img1" /> 2<pre>Make and model: <span id="makeAndModel"></span></pre> 3<br/> 4<img src="image2.jpg" id="img2" /> 5<pre id="allMetaDataSpan"></pre> 6<br/>
Note there are also alternate tags, such the EXIF.TiffTags
. See the source code for the full definition and use.
You can also get back a string with all the EXIF information in the image pretty printed by using EXIF.pretty
.
Check the included index.html.
XMP
Since issue #53 was merged also extracting of XMP data is supported. To not slow down this is optional, and you need to call EXIF.enableXmp();
before using ..getDatat()
.
Please refer to the source code for more advanced usages such as getting image data from a File/Blob object (EXIF.readFromBinaryFile
).
This is an open source project. Please contribute by forking this repo and issueing a pull request. The project has had notable contributions already, like reading ITPC data.
You can also contribute by filing bugs or new features please issue. Or improve the documentation. Please update this README when you do a pull request of proposed changes in base functionality.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 12/22 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More