Giter Club home page Giter Club logo

extract-iptc's Introduction

extract-iptc

Simple wrapper and parser around imagemagick's convert CLI utility call to extract IPTC/XMP metadata.

Installation

npm install extract-iptc

Usage

var ExtractIptc = require('extract-iptc');

// if convert utility isn'n in PATH variable
ExtractIptc.setImageMagickConvertPath('/path/to/bin/convert');

ExtractIptc.extract('/path/to/image.jpg', function (error, meta) { 
    if (error) {
        console.error(error);
    }
    console.log('Title is: ' + meta.title);
    if (meta.keywords) {
        if (typeof meta.keywords === 'string') {
            console.log('Single keyword is: ' + meta.keywords);
        } else {
            console.log('Keywords are: ' + meta.keywords.join(', '));
        }
    }
    console.log('Copyrighted by: ' + meta.copyright);
});

Resulting meta object fields reference

NB. Returns array for any tag values with multiple occurrences.

extract-iptc IPTC XMP
title Object Name Title
urgency Urgency Urgency
category Category Category
supplementalCategory Supplemental Category Supplemental Categories
keywords Keywords Keywords
instructions Special Instruction Instructions
dateCreated Date Created Date Created
author By-line Author
authorsPosition By-line Title AuthorsPosition
city City City
state Province/State State/Province
country Country/Primary Location Name Country
transmissionReference Original Transmission Reference Transmission Reference
headline Headline Headline
credit Credit Credit
source Source Source
copyright Copyright Notice Copyright Notice
description Caption/Abstract Description
writer Writer/Editor Description Writer

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.