https://github.com/victrme/exif-js
Modernized javascript library for reading EXIF image metadata
https://github.com/victrme/exif-js
exif exif-js javascript jpeg library metadata tiff
Last synced: 5 months ago
JSON representation
Modernized javascript library for reading EXIF image metadata
- Host: GitHub
- URL: https://github.com/victrme/exif-js
- Owner: victrme
- License: mit
- Created: 2025-04-04T06:42:27.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-08T06:02:18.000Z (about 1 year ago)
- Last Synced: 2025-09-17T20:11:05.034Z (10 months ago)
- Topics: exif, exif-js, javascript, jpeg, library, metadata, tiff
- Language: JavaScript
- Homepage: https://exif-js.pages.dev
- Size: 1.32 MB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
_This is a fork of [exif-js by @jseidelin](https://github.com/exif-js/exif-js/)_
# Exif.js
A JavaScript library for reading [EXIF meta data](https://en.wikipedia.org/wiki/Exchangeable_image_file_format) from image files.
Use it on images in the browser, either from an image or a file input element. Both EXIF and IPTC metadata are retrieved. The EXIF standard applies only to `.jpg` and `.tiff` images. EXIF logic in this package is based on the EXIF standard v2.2.
Test with this demo: https://exif-js.pages.dev/
## Install
- Install from jsr: https://jsr.io/@victr/exif-js
- Install from npm: https://www.npmjs.com/package/@victr/exif-js
```bash
# jsr
deno add jsr:@victr/exif-js
# npm
npm install @victr/exif-js
```
## Usage
Start with calling the `getData` method. You pass it an image as a parameter:
- either an image from a `
`
- OR a user selected image in a `` element on your page.
You receive an object with exif, iptc, and xmp data.
**JavaScript**:
```javascript
import { Exifjs } from "@victr/exif-js"
const reader = new Exifjs()
async function getExif() {
const img1 = document.getElementById("img1")
const img2 = document.getElementById("img2")
const makeAndModel = document.getElementById("makeAndModel")
const allMetaDataSpan = document.getElementById("allMetaDataSpan")
const { exif } = await reader.getData(img)
const make = exif["Make"]
const model = exif["Model"]
makeAndModel.textContent = `${make} ${model}`
const data = await reader.getData(img2)
const pretty = reader.pretty()
allMetaDataSpan.textContent = pretty
}
```
**HTML**:
```html
Make and model:
```
## What changed
- Removed CommonJS
- Replaced global variables with self-contained Exifjs class
- Improved editor autocomplete with JSDoc
- Replaced callbacks with async
- Stronger code with stricter linter