New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

simple-exiftool

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-exiftool

Extracting metadata from media files with exiftool, including but not limited to mp4, mov, 3gp, jpg, png, gif, pdf.

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
104
6.12%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

exiftool is a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in a wide variety of files.

This npm package is a simple wrapper for exiftool, you can extract metadata / meta information from media files easily. Like; video duration, image resolution etc.

You can see complete list of supported media files from here including but not limited to jpg, png, gif, mp4, mov, 3gp, pdf.

  • simple-exiftool requires Node v4+

Quick Installation

  • OS X:
brew update
brew install exiftool
npm install simple-exiftool --save
  • Ubuntu:
sudo apt-get update
sudo apt-get install libimage-exiftool-perl
npm install simple-exiftool --save

Usage

const Exif = require("simple-exiftool");
Exif(source, [settings], callback);

// Default settings are
// {
// 		binary: "exiftool",
//		args: ["-json", "-n"]
// }
// 
// -json argument can not be overriden, since this module parse outputs of exiftool with JSON.parse

###1. Passing single media file path

const Exif = require("simple-exiftool");

Exif("/x/y/image.jpg", (error, metadata) => {
	
	if (error) {
        // handle error
	}
	console.log(metadata);
});

###2. Passing array of media files path

const Exif = require("simple-exiftool");

Exif(["/x/yimage.jpg", "/a/bmovie.mp4"], (error, metadataArray) => {

	if (error) {
        // handle error
	}
	console.log(metadataArray[0], metadataArray[1]);
});

###3. Passing binary data

const Exif = require("simple-exiftool");
const Fs = require("fs");

Fs.readFile("/x/y/image.jpg", (error, binaryData) => {

	if (error) {
        // handle error
	}

	Exif(binaryData, (error, metada) => {

		if (error) {
            // handle error
		}
		console.log(metada);
	});
});

###4. Exiftool binary path and extra arguments

const Exif = require("simple-exiftool");

Exif("/x/y/image.jpg", {binary: "exiftool2", args:["-json", "-s"]}, (error, metadataArray) => {

	if (error) {
        // handle error
	}
	console.log(metadataArray[0], metadataArray[1]);
});

Keywords

exif

FAQs

Package last updated on 30 Jun 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