3.0.1 • Published 8 years ago

im-metadata v3.0.1

Weekly downloads
417
License
MIT
Repository
github
Last release
8 years ago

im-metadata

Build status NPM downloads NPM version Node version Dependency status

Retrieve image metadata as a JSON object using ImageMagick's identify command.

Requiremets

  • Node.JS v0.10 or newer
  • ImageMagick v6.8 or newer

Install

npm install im-metadata --save

API

var metadata = require('im-metadata');

metadata(string src, object opts, function callback)

Return metadata object for a given src image.

  • string src - path to the image on disk
  • object opts - metadata parsing options
    • boolean exif - return exif data or not (default false)
    • boolean autoOrient - auto-orient height/width (default false)
    • integer timeout - command timeout length (default 5000)
  • function callback - callback function (Error error, object data)
    • Error error - error output if command failed
    • object data - parsed metadata object

Return

Returns an object with parsed metada:

  • string path - original image path
  • string name - original image name
  • string size - image file size in bytes (ex. 4504682)
  • string format - image format (JPEG, PNG, TIFF etc.)
  • string colorspace - image colorspace (RGB, CMYK etc.)
  • integer height - image pixel height
  • integer width - image pixel width
  • string orientation - image orientation

Example

metadata('/path/to/image.jpg', {exif: true}, function(error, metadata) {
  if (error) { console.error(error); }
  console.log(metadata);
  console.log(metadata.exif);
});

MIT License

3.0.1

8 years ago

3.0.0

10 years ago

2.2.2

10 years ago

2.2.1

10 years ago

2.2.0

10 years ago

2.1.1

10 years ago

2.1.0

10 years ago

2.0.0

10 years ago

1.1.0

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago