Socket
Socket
Sign inDemoInstall

extract-iptc

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    extract-iptc

Extracts IPTC/XMP metadata from images


Version published
Maintainers
1
Install size
25.0 kB
Created

Readme

Source

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-iptcIPTCXMP
titleObject NameTitle
urgencyUrgencyUrgency
categoryCategoryCategory
supplementalCategorySupplemental CategorySupplemental Categories
keywordsKeywordsKeywords
instructionsSpecial InstructionInstructions
dateCreatedDate CreatedDate Created
authorBy-lineAuthor
authorsPositionBy-line TitleAuthorsPosition
cityCityCity
stateProvince/StateState/Province
countryCountry/Primary Location NameCountry
transmissionReferenceOriginal Transmission ReferenceTransmission Reference
headlineHeadlineHeadline
creditCreditCredit
sourceSourceSource
copyrightCopyright NoticeCopyright Notice
descriptionCaption/AbstractDescription
writerWriter/EditorDescription Writer

Keywords

FAQs

Last updated on 03 Jan 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc