Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

im-metadata

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

im-metadata

Retrieve image metadata using ImageMagick's identify command

  • 3.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

Keywords

FAQs

Package last updated on 26 Dec 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