New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

exiftool-vendored

Package Overview
Dependencies
Maintainers
1
Versions
252
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exiftool-vendored

Efficient, cross-platform access to ExifTool

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21K
increased by4.88%
Maintainers
1
Weekly downloads
 
Created
Source

exiftool-vendored

Efficient, cross-platform node access to ExifTool.

npm version Build Status Build status

Unique Features

  1. Uses -stay_open mode by default, which can be up to 60x faster than other packages*

  2. Parsing of

    • dates (even though EXIF doesn't include timezone offset data)
    • latitudes & longitudes into proper floats (where negative values indicate W or S of the meridian)
  3. Robust type definitions of the top 99.5% of tags used by over 3,000 different camera makes and models

  4. Auditable ExifTool source code (the "vendored" code is verifiable)

  5. Automated updates to ExifTool (as new versions come out monthly)

  6. Tested on node v6+ on Linux, Mac, & Windows.

Installation

npm install --save exiftool-vendored

The vendored version of ExifTool relevant for your platform will be installed via platform-dependent-modules.

Usage

// `exiftool` is a singleton instance of the `ExifTool` class
import { exiftool } from "exiftool-vendored"
// ExifTool.read() returns a Promise<Tags>
exiftool.read("path/to/file.jpg").then(tags => {
  console.log(`Make: ${metadata.Make}, Model: ${metadata.Model}`)
})

Official EXIF tag names are PascalCased, like AFPointSelected and ISO. ("Fixing" the field names to be camelCase, would result in ungainly aFPointSelected and iSO atrocities).

Dates

Generally, EXIF tags encode dates and times with no timezone offset. Presumably the time is captured in local time, but this means parsing the same file in different parts of the world results in a different absolute timestamp for the same file.

Rather than returning a Date, which always includes a timezone, this library returns classes that encode the date, the time of day, or both, with an optional tzoffset. It's up to you, then to do what's right.

It's not all bad news, though! In cases where a GPS UTC timestamp is encoded with the image (like from most smartphone cameras), the timezone offset can be inferred, and will be encoded in the related ExifDates for those files.

const d /*: ExifDate*/ = metadata.DateTimeOriginal
// if you simply must have a Date
const onlyCorrectIfSmartphoneOrYouTookThePhotoInTheSameTimezoneOffsetAsItIsLocally: Date = 
  d.toDate()

stay_open

Starting the perl version of ExifTool is expensive, and is especially expensive on the Windows version of ExifTool.

On Windows, a distribution of Perl and the ~1000 files that make up ExifTool are extracted into a temporary directory for every invocation. Windows virus scanners that wedge reads on these files until they've been determined to be safe make this approach even more costly.

Using -stay_open we can reuse a single instance of ExifTool across all requests, which drops response latency dramatically.

Tags

The tags.ts file is autogenerated by parsing through images of more than 3,000 different camera makes and models taken from the ExifTool site. It groups tags, their type, frequency, and example values such that your IDE can autocomplete

Versioning

I wanted to include the ExifTool's version number explicitly in the version number, but npm requires strict compliance with SemVer. Given that ExifTool sometimes includes patch releases, there aren't always enough spots to encode an API version and the ExifTool version.

Given those constraints, version numbers follow the following scheme:

  $API.$UPDATE.$PATCH
  • Breaking API changes to this package will increment API.
  • Any bugfix or new release of ExifTool will increment UPDATE.
  • Metadata changes or trivial bugfixes will increment PATCH.

Note that the platform dependent modules use the ExifTool version with an optional patch release.

v0.1.0

Initial Release. Packages ExifTool v10.31.

Keywords

FAQs

Package last updated on 23 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc