All Projects → terkelg → Exifer

terkelg / Exifer

Licence: mit
A lightweight Exif meta-data decipher.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Exifer

exiftool-json-db
Maintain a JSON database of photos and videos with their metadata
Stars: ✭ 18 (-93.79%)
Mutual labels:  metadata, photos, exif
Exiftool Vendored.js
Fast, cross-platform Node.js access to ExifTool
Stars: ✭ 200 (-31.03%)
Mutual labels:  metadata, photos, exif
Exifr
📷 The fastest and most versatile JS EXIF reading library.
Stars: ✭ 448 (+54.48%)
Mutual labels:  parser, metadata, exif
Atldotnet
Fully managed, portable and easy-to-use C# library to read and edit audio data and metadata (tags) from various audio formats, playlists and CUE sheets
Stars: ✭ 180 (-37.93%)
Mutual labels:  parser, metadata
Parser Javascript
Browser sniffing gone too far — A useragent parser library for JavaScript
Stars: ✭ 66 (-77.24%)
Mutual labels:  parser, browser
Blockchain Parser
The simpliest script for parsing Bitcoin blockchain. It made convertion of blk*****.dat files to the simple text.
Stars: ✭ 84 (-71.03%)
Mutual labels:  parser, browser
Metadata Extractor
Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Stars: ✭ 1,972 (+580%)
Mutual labels:  metadata, exif
rexiv2
Rust library for read/write access to media-file metadata (Exif, XMP, and IPTC)
Stars: ✭ 64 (-77.93%)
Mutual labels:  metadata, exif
Device Detector Js
A precise user agent parser and device detector written in TypeScript
Stars: ✭ 193 (-33.45%)
Mutual labels:  parser, browser
iptcinfo3
iptcinfo working for python 3 finally do pip3 install iptcinfo3
Stars: ✭ 37 (-87.24%)
Mutual labels:  metadata, exif
goexif2
MAINTAINER WANTED -- Decode embedded EXIF meta data from image files written in Pure Golang
Stars: ✭ 35 (-87.93%)
Mutual labels:  metadata, exif
pyexiv2
Read/Write metadata(including EXIF, IPTC, XMP), comment and ICC Profile embedded in digital images.
Stars: ✭ 120 (-58.62%)
Mutual labels:  metadata, exif
Forensic Tools
A collection of tools for forensic analysis
Stars: ✭ 204 (-29.66%)
Mutual labels:  metadata, exif
Graphql S2s
Add GraphQL Schema support for type inheritance, generic typing, metadata decoration. Transpile the enriched GraphQL string schema into the standard string schema understood by graphql.js and the Apollo server client.
Stars: ✭ 171 (-41.03%)
Mutual labels:  parser, metadata
picsort
Organize your photos by date in one click 👏
Stars: ✭ 22 (-92.41%)
Mutual labels:  photos, exif
Goose Parser
Universal scrapping tool, which allows you to extract data using multiple environments
Stars: ✭ 211 (-27.24%)
Mutual labels:  parser, browser
Photostructure For Servers
PhotoStructure for Servers
Stars: ✭ 98 (-66.21%)
Mutual labels:  metadata, photos
Ut metadata
BitTorrent Extension for Peers to Send Metadata Files (BEP 9)
Stars: ✭ 98 (-66.21%)
Mutual labels:  metadata, browser
facebook-data-image-exif
UI tool to add EXIF data back to images in a Facebook data export
Stars: ✭ 39 (-86.55%)
Mutual labels:  photos, exif
photos2geojson
html map gallery from photos
Stars: ✭ 39 (-86.55%)
Mutual labels:  photos, exif

exifer

version integration status codecov gzip size

A lightweight exif image meta-data decipher
Exifer is a small module that read JPEG/TIFF meta-data.

Exif tags/fields are used to encode additional information into images taken by digital still cameras. The exif meta information is organized into different Image File Directories (IFD's) within the image. It contains useful information like image rotation, GPS coordinates, times stamps. ISO, etc.

Features

  • 📦 Lightweight: Small with zero Dependencies
  • 🔍 Extract Exif, GPS, XMP and IPTC
  • 📷 Files: Support both JPEG, DNG and TIFF files
  • 📚 Add-ons: Extra tags and parsers available
  • ♻️ Isomorphic: Works in node.js and the browser

This module exposes three module definitions:

  • ES Module: dist/exifer.mjs
  • UMD: dist/exifer.umd.js
  • CommonJS: dist/exifer.js

Install

$ npm install exifer

The script can also be directly included from unpkg.com:

<script src="https://unpkg.com/exifer"></script>

Usage

import exifer from 'exifer';
import fs from 'fs';

const buffer = fs.readFileSync('photo.jpg');
const tags = await exifer(buffer);
// {
//   Make: 'Apple',
//   Model: 'iPhone X',
//   Orientation: 6,
//   Software: '12.4',
//   ModifyDate: '2019:08:25 15:07:02',
//   ... and so on
// }

OBS: Exifer only reads a few tags by default. You can add your own or use add-on modules to read and parse additional tags.

API

exifer(input, [opts])

Returns: object <Promise>

Takes a JPEG, DNG or JIFF image as input and returns an object with extracted meta-data. A Promise is returned that resolves to an hash-map of tag/value pairs.

Exifer only reads the most essential tags out of the box – which should cover 99% of all use cases.

To read or parse more tags chekcout opts.tags.

input

Type: Buffer|ArrayBuffer|File

Example running in the browser reading a File (ArrayBuffer):

import exifer from 'exifer';

/**
 * Assume 'input' is the value coming from an input field:
 * <input type="file" accept="image/*" id="input" >
 */

const input = document.getElementById('#input').files[0];
const tags = await exifer(input);

Example running in node.js reading a JPEG Buffer:

import exifer from 'exifer';
import fs from 'fs';

const buffer = fs.readFileSync('photo.jpg');
const tags = await exifer(buffer);

It's recomended to only feed Exifer some of the image buffer when dealing with very large files. The first 500kb should be enough in most cases:

import exifer from 'exifer';
import fs from 'fs';

const full = fs.readFileSync('photo.jpg');
const slice = full.buffer.slice(0, 0.5 * 1024 * 1024);
const tags = await exifer(slice);

opts.tags

Type: object

Exifer does not extract more than the most essential tags.

You can extract additional tags, or overwrite the default tags, if you want to read more tags than what's provided by default or wamt custom parsers. You can do this by passing tag objects to either tags.exif, tags.gps and/or tags.iptc.

The key for additional IFD image tags is the IFD field code in hexadecimal notation. The value is a tag object with at least a name property.

Here's an example where Exifer is instructed to read two additional gps tags. They are passed as tag objects to tags.gps:

import exifer from 'exifer';
import fs from 'fs';

// try to read more GPS tags and parse timestamp
const gps = {
  0x0001: {name: 'GPSLatitudeRef'},
  0x0007: {name: 'GPSTimeStamp', parse: x => {
    return new Date(Date.UTC(1970, 0, 1, x[0], x[1], x[2]));
  }}
}

const buffer = fs.readFileSync('photo.jpg');
const parsed = await exifer(buffer, {tags: { gps }});
// {
//    ...
//    GPSLatitudeRef: 'N',
//    GPSTimeStamp: 1970-01-01T19:06:58.000Z
//    ...
// }
opts.tags.exif

Type: object
default: {}

Hash-map with additonal exif tags.

OBS: Find list of exif tags here

opts.tags.iptc

Type: object
default: {}

Hash-map with additonal IPTC tags.

OBS: Find list of IPTC tags here

opts.tags.gps

Type: object
default: {}

Hash-map with additonal GPS tags.

OBS: Find list of exif tags here

Add-ons

If you want to read all tags the following exifer add-on packages have you covered:

To read and parse all exif and tiff tags using add-ons, you simply import and pass them to the corresponding tags option:

import exifer from 'exifer';
import iptc from '@exifer/iptc';
import exif from '@exifer/exif';
import fs from 'fs';

const buffer = fs.readFileSync('photo.jpg');
const parsed = await exifer(buffer, {tags: { exif, iptc }});

options.skipexif

Type: boolean
Default: false

Skip exif tags.

options.skipiptc

Type: boolean
Default: false

Skip IPTC tags.

options.skipxmp

Type: boolean
Default: false

Skip XMP tags.

Tag

Type: Object

Exifer only comes with a few built-in tags. None of the default tag objects have parsers associated with them.

Example with a rather useless parser:

{name: 'ModifyDate', raw: false, parse: x => `date is ${x}`}

tag.name

Type: String

Required tag name. This is used as the key in the returned result object from exifer.

OBS: name is the only required porperty.

tag.raw

Type: Boolean
Default: false

By default all tags are interpreted as ASCII strings. Set raw to true to get the raw tag value.

tag.parse

Type: Function

Custom parser function. Use this to transform tag values. Input is a ASCII string unless raw is true.

The returned output is used in the final result object returned by exifer.

Credit

Inspired by exif-orientation and ExifReader.

License

MIT © Terkel Gjervig

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].