# exif-reader

> A small EXIF image metadata reader

Latest version **2.0.3** (published 2025-12-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install exif-reader
pnpm add exif-reader
yarn add exif-reader
bun add exif-reader
```

## Health

**Score 55/100 (C)** — status: stable.

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2025-12-12 |
| First published | 2015-03-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 32.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 174 |
| Author | Devon Govett |
| Maintainers | devongovett, lovell |
| Keywords | exif, image, metadata |

## Links

- npm: https://www.npmjs.com/package/exif-reader
- Repository: https://github.com/devongovett/exif-reader
- Issues: https://github.com/devongovett/exif-reader/issues
- npm.io page: https://npm.io/package/exif-reader

## 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

- 2.0.3 (latest) — 2025-12-12
- 2.0.2 — 2025-01-14
- 2.0.1 — 2024-01-28
- 2.0.0 — 2023-09-26
- 1.2.0 — 2023-03-03
- 1.1.0 — 2022-12-22
- 1.0.3 — 2019-09-30
- 1.0.2 — 2017-01-06
- 1.0.1 — 2016-07-15
- 1.0.0 — 2015-03-06

## README

# exif-reader

A small EXIF image metadata reader.

## Usage

    npm install exif-reader


```javascript
var exif = require('exif-reader');

// decode raw exif data from a buffer
var metadata = exif(buf);
```

Support is also built into [jpg-stream](https://github.com/devongovett/jpg-stream) for extracting EXIF data from JPEGs using this module.

Resulting properties are grouped as follows:

* `bigEndian`: determines the endianness of the buffers (in case of non-ascii data)
* `Image`: basic TIFF properties about the image
* `Thumbnail`: basic TIFF properties about the embedded thumbnail
* `Photo`: full exif data
* `GPSInfo`: GPS/location data about the image
* `Iop`: interoperability information

Not all of these properties will always be defined.

All [standard Exif tags](https://exiv2.org/tags.html) are supported.

Here is some example output:

```
{
  bigEndian: false,
  Image: {
    ImageWidth: 2448,
    ImageLength: 3264,
    Make: 'Some Make',
    Model: 'Some Model',
    Orientation: 1,
    XResolution: 72,
    YResolution: 72,
    ResolutionUnit: 2,
    Software: 'HDR+ 1.0.520435816zd',
    DateTime: 2023-05-20T17:02:00.000Z,
    YCbCrPositioning: 1,
  },
  Thumbnail: {
    ImageWidth: 219,
    ImageLength: 292,
    Compression: 6,
    Orientation: 1,
    XResolution: 72,
    YResolution: 72,
    ResolutionUnit: 2,
  },
  Photo: {
    ExposureTime: 0.016679,
    FNumber: 2,
    ExposureProgram: 2,
    ISOSpeedRatings: 129,
    ExifVersion: Buffer(4) [Uint8Array] [ 48, 50, 51, 50 ],
    DateTimeOriginal: 2023-05-20T17:02:00.000Z,
    DateTimeDigitized: 2023-05-20T17:02:00.000Z,
    OffsetTime: '+02:00',
    OffsetTimeOriginal: '+02:00',
    OffsetTimeDigitized: '+02:00',
    ShutterSpeedValue: 5.91,
    ApertureValue: 2,
    BrightnessValue: 2.54,
    ExposureBiasValue: 0,
    MaxApertureValue: 2,
    SubjectDistance: 0.35,
    MeteringMode: 2,
    Flash: 16,
    FocalLength: 2.57,
    SubSecTime: '811',
    SubSecTimeOriginal: '811',
    SubSecTimeDigitized: '811',
    FlashpixVersion: Buffer(4) [Uint8Array] [ 48, 49, 48, 48 ],
    ColorSpace: 1,
    PixelXDimension: 2448,
    PixelYDimension: 3264,
    InteroperabilityTag: 958,
    SensingMethod: 2,
    CustomRendered: 1,
    ExposureMode: 0,
    WhiteBalance: 0,
    DigitalZoomRatio: 1.4,
    FocalLengthIn35mmFilm: 24,
    SceneCaptureType: 0,
    Contrast: 0,
    Saturation: 0,
    Sharpness: 0,
    SubjectDistanceRange: 1,
    LensMake: 'Some Lens Make',
    LensModel: 'Some front camera 2.57mm f/2.0',
    CompositeImage: 3
  },
  GPSInfo: {
    GPSLatitudeRef: 'N',
    GPSLatitude: [ 49, 1, 3.12 ],
    GPSLongitudeRef: 'E',
    GPSLongitude: [ 11, 1, 4.56 ],
    GPSAltitudeRef: 0,
    GPSAltitude: 296.1,
    GPSTimeStamp: [ 15, 1, 48 ],
    GPSImgDirectionRef: 'M',
    GPSImgDirection: 258,
    GPSDateStamp: '2023:05:20'
  }
}
```

## License

MIT

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