imt

imtype

Get correct image type

Showing:

Popularity

Downloads/wk

1

GitHub Stars

1

Maintenance

Last Commit

7yrs ago

Contributors

1

Package

Dependencies

0

Size (min+gzip)

0.3KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

imagetype

Get correct image type

Install

npm install imtype

Support Image type

  • jpeg
  • png
  • gif
  • tiff
  • bmp

Usage

var imtype = require('imtype');
var fs = require('fs');

// isJPG;
var data = fs.readFileSync('foo.jpg');
console.log(imtype.isJPG(data));

// isPNG
var data = fs.readFileSync('foo.png');
console.log(imtype.isPNG(data));

// isGIF
var data = fs.readFileSync('foo.gif');
console.log(imtype.isGIF(data));

// isBMP
var data = fs.readFileSync('foo.bmp');
console.log(imtype.isBMP(data));

// isTIF
var data = fs.readFileSync('foo.tif');
console.log(imtype.isTIF(data));

Test

make test

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100