# image-meta-js

> Exif parser for JPEG images

Latest version **1.0.2** (published 2019-07-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install image-meta-js
pnpm add image-meta-js
yarn add image-meta-js
bun add image-meta-js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-07-27 |
| First published | 2019-06-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 28 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Aaron Cunliffe |
| Maintainers | aaroncunliffe |
| Keywords | exif, image, jpeg, jpg, gps |

## Links

- npm: https://www.npmjs.com/package/image-meta-js
- npm.io page: https://npm.io/package/image-meta-js

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2019-07-27
- 1.0.1 — 2019-06-29
- 1.0.0 — 2019-06-29

## README

# Image Meta JS [![Build Status](https://travis-ci.org/Aaroncunliffe/image-meta-js.svg?branch=master)](https://travis-ci.org/Aaroncunliffe/image-meta-js)

An npm package to parse EXIF data from images with a simple to use interface and minimal dependencies (currently only works with JPEG images)

## Getting Started

### Install
using npm
```
npm install --save image-meta-js
```

### Usage
The constructor expects a DataView to be passed in, DataViews can be created from ArrayBuffers that can be fetched from files many ways. For example allows running using the Node 'fs' package or FileReader in the web browser

```javascript
let imageMeta = new ImageMeta(imageDataView)
let data = imageMeta.data(); // returns object of all found data

// e.g. get exposure triangle
data.FNumber      // 2.8
data.ExposureTime // 1/100
data.ISO          // 800
```

Node:
```javascript
file = fs.readFileSync('./test/img.jpg');
let imageArrayBuffer = file.buffer
let imageDataView = new DataView(imageArrayBuffer);
let imageMeta = new ImageMeta(imageDataView)
```

Browser:
```javascript
let reader = new FileReader();
reader.onload = () => {
  let imageArrayBuffer = reader.result;
  let imageDataView = new DataView(imageArrayBuffer);
  let imageMeta = new ImageMeta(imageDataView);
}
reader.readAsArrayBuffer(file);
```

The full possible tag list can be found [here](https://sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html)

## Tests

Tests using [Mocha](https://www.npmjs.com/package/mocha) and automated on commits using [Travis-CI](https://travis-ci.org)
They are simple tests using images with known values and ensuring that the format handling is working as expected

## License

This project is licensed under the MIT License

#### Useful Resources
- [Image format resource](https://www.media.mit.edu/pia/Research/deepview/exif.html) - Breaks down the image binary into sections
- [All possible tags resource](https://sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html) - Lists all tags according to the spec and their types
- [Sample images](https://github.com/ianare/exif-samples) - sample images with some very specific data such as MakerNote section or GPS tags, useful for testing

---
_Source: https://npm.io/package/image-meta-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
