se

simple-exiftool

simple-exiftool

Showing:

Popularity

Downloads/wk

119

GitHub Stars

5

Maintenance

Last Commit

5yrs ago

Contributors

0

Package

Dependencies

1

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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]);
});

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial