Skip to content

A node.js package that returns information about an image or flash file such as type, dimensions etc.

Notifications You must be signed in to change notification settings

ankakaak/node-imageinfo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

node-imageinfo

This is a small package for node.js to allow the analysis of image data in a Buffer, and return mime-type, and image dimensions for the data.

It is designed to be fast, completely written in javascript.

Currently it supports Png, Jpeg, Gif and Swf(uncompressed, deflate and LZMA) analysis.

Usage:

To install imageinfo into your project, use npm install imageinfo, then it's simply a matter of calling it with the buffer object containing your image, like this:

var imageinfo = require('imageinfo'),
	fs = require('fs');

fs.readFile('testimage', function(err, data) {
	if (err) throw err;

	imageinfo(data, function (info) {
		console.log("Data is type:", info.mimeType);
		console.log("Size:", data.length, "bytes");
		console.log("Dimensions:", info.width, "x", info.height);
	});
	
});

License:

Project code is released under CC0 license:

CC0

About

A node.js package that returns information about an image or flash file such as type, dimensions etc.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%