xmp-reader
Extracts basic XMP/RDF metadata from JPEG files
Last updated 4 years ago by shkuznetsov .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install xmp-reader 
SYNC missed versions from official npm registry.

xmp-reader NPM version Build Status

Extracts some commonly used XMP/RDF metadata tags from JPEG files. Does not pretend to be a complete metadata management tool, but allows you to extract some information other EXIF-management tools on NPM fail to retrieve. Was originally created only to extract a Description field baked into my JPEGs by Google's Picasa.

Usage

To install the module add it to your project's package.json dependencies or install manually running:

npm install xmp-reader

Then pull it in your code:

const xmpReader = require('xmp-reader');

Now you can either feed it a file name:

xmpReader.fromFile('/path/to/file.jpg', (err, data) => {
  if (err) console.log(err);
  else console.log(data);
});

Or a buffer:

xmpReader.fromBuffer(buffer, (err, data) => {
  if (err) console.log(err);
  else console.log(data);
});

Both methods above return a promise, you can use that instead of the callback:

xmpReader.fromBuffer(buffer).then(
  (data) => console.log(data),
  (err) => console.log(err)
);

Output will look something like that, depending on your metadata:

{
	"raw": {
		"MicrosoftPhoto:Rating": "50",
		"dc:title": "Title",
		"dc:description": "Title",
		"dc:creator": "Alexander Kuznetsov",
		"Iptc4xmpCore:Location": "New York",
		"MicrosoftPhoto:LastKeywordXMP": ["tag1", "tag2"],
		"MicrosoftPhoto:LastKeywordIPTC": ["tag1", "tag2"],
		"xmp:Rating": "3"
	},
	"rating": 3,
	"title": "Title",
	"description": "Title",
	"creator": "Alexander Kuznetsov",
	"location": "New York",
	"keywords": ["tag1", "tag2"]
}

raw property contains vendor-specific tag names.

License

MIT License

Current Tags

  • 0.0.3                                ...           latest (4 years ago)

3 Versions

  • 0.0.3                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 0
Last Month 2
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |