0.3.0 • Published 10 years ago

imagetype v0.3.0

Weekly downloads
15
License
-
Repository
github
Last release
10 years ago

node-imagetype

This is a simple module to check the type of an image from its magic number (without having to load the whole image). It currently works for JPEGs, PNGs, GIFs, BMPs and ICOs.

Example

var imagetype = require('imagetype');

imagetype(pathToImage, function(type) {
  // type can take the following values:
  // 'jpeg', 'png', 'gif', 'bmp', 'ico' or null if the type is not recognized
  console.log('The image type is', type);
});