read-exif

1.0.0 • Public • Published

read-exif

npm version Build Status codecov

A Node.js module to get Exif data from a JPEG file

const readExif = require('read-exif');
 
(async () => {
  const exif = (await readExif('example.jpg')).Exif;
 
  // 34855: ID of the `ISOSpeedRatings` tag
  exif['33434']; //=> 250
 
  // 36868: ID of the `DateTimeDigitized` tag
  exif['36867']; //=> '2018:06:03 08:49:11'
})();

Designed to be memory and CPU efficient, as this module doesn't read entire file contents but read only a necessary part of a file.

Installation

Use npm.

npm install read-exif

API

const readExif = require('read-exif');

readExif(path)

path: string | Buffer | Uint8Array | URL (path to a JPEG file)
Return: Object

It reads Exif data from a file using Piexifjs, and returns it as an Object.

getExif(new URL('file:///Users/shinnn/example.jpg')); /*=> {
  '0th': { ... },
  '1st': { ... },
  Exif: { ... },
  GPS: { ... }
  Interop: { ... },
  thumbnail: ' ... '
*/

License

ISC License © 2019 Shinnosuke Watanabe

Package Sidebar

Install

npm i read-exif

Weekly Downloads

7

Version

1.0.0

License

ISC

Unpacked Size

4.8 kB

Total Files

4

Last publish

Collaborators

  • shinnn