GithubHelp home page GithubHelp logo

maciekmaciej / node-im-metadata Goto Github PK

View Code? Open in Web Editor NEW

This project forked from turistforeningen/node-im-metadata

0.0 1.0 0.0 29.36 MB

Retrieve image metadata using ImageMagick's identify command

License: MIT License

JavaScript 100.00%

node-im-metadata's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.