# image-info-extractor

> A lib to read image info and to extract/parse image metadata

Latest version **0.1.1** (published 2024-01-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install image-info-extractor
pnpm add image-info-extractor
yarn add image-info-extractor
bun add image-info-extractor
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2024-01-08 |
| First published | 2023-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 407.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Fuwei Chin |
| Maintainers | fuweichin |
| Keywords | metadata, reader, EXIF, XMP, ICC, extrator |

## Links

- npm: https://www.npmjs.com/package/image-info-extractor
- Repository: https://github.com/fuweichin/image-info-extractor
- Homepage: https://github.com/fuweichin/image-info-extractor#readme
- Issues: https://github.com/fuweichin/image-info-extractor/issues
- npm.io page: https://npm.io/package/image-info-extractor

## Recent versions

- 0.1.1 (latest) — 2024-01-08
- 0.1.0 — 2023-08-07

## README

# Image Info Extractor

A JavaScript lib to read image info and to extract/parse image metadata.



> **Warning**
> This project is currently experimental.



## Features

This lib supports most web image formats: JPEG, PNG, WebP, AVIF, SVG.

### Image info reading

Image info reading support: width, height, alpha, bit depth, animation, lossless, rotation, mirror, progressive, grided

Note: the `width` and `height` are directly retrieved, you should also look at the `rotation` and `mirror` to render an image properly.

### Metadata extracting

Metadata extracting support: EXIF, XMP, ICC

Additional extracting support: JFIF, Extended XMP, IPTC for JPEG, XMP in SVG

Table 1: raster image metadata extracting support <small>(Y: yes, N: no)</small>


| Image format \\ Metadata format | EXIF | XMP  | ICC  |
| ------------------------------- | ---- | ---- | ---- |
| JPEG                            | Y    | Y    | Y    |
| PNG                             | Y    | Y    | Y    |
| WebP                            | Y    | Y    | Y    |
| AVIF                            | Y    | Y    | Y    |

### Metadata parsing

Metadata parsing support: EXIF 2.32, XMP 1.0, ICC 4.4

Optional support:

+ Vendor-specific XMP tag type mapping

TODOs:

+ Vendor-specific EXIF MakerNote parsing

### Data getters

+ Thumbnail data in EXIF
+ GPS info in EXIF
+ Date tags in EXIF



![demo of Image Info Extractor ](./examples/screenshot_1.png)

![demo of Image Info Extractor ](./examples/screenshot_2.png)



## Install

### Browser Requirements

+ Chromium 80
+ Firefox 113
+ Safari 16.4

### Install with NPM


```sh
npm install image-info-extractor
```



## Usage

```js
import {readFile, parseResult} from 'image-info-extractor';

// first, pick a file

// then pass the file to extractor
readFile(file).then(parseResult).then((result) => {
  console.log('result', result);
});
```

For detailed usage, see [image-info-extractor](examples/image-info-extractor.html) and [sidecar-file-viewer](examples/sidecar-file-viewer.html) under [examples/](examples/) 



## Related Efforts

This project is derived, with heavy modifications, from
+ https://github.com/titarenko/fast-exif
+ https://github.com/devongovett/exif-reader
+ https://github.com/lovell/icc



### License

[MIT](./LICENSE)

Copyright &copy; 2023 Fuwei Chin and others

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