0.1.3 • Published 8 years ago

extract-iptc v0.1.3

Weekly downloads
13
License
ISC
Repository
github
Last release
8 years ago

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
0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago