npm install image-size
var sizeOf = require('image-size');
var dimensions = sizeOf('images/funny-cats.png');
console.log(dimensions.width, dimensions.height);
var sizeOf = require('image-size');
sizeOf('images/funny-cats.png', function (err, dimensions) {
console.log(dimensions.width, dimensions.height);
});
- BMP
- GIF
- JPEG
- PNG
- PSD
- TIFF
- WebP
not a direct port, but an attempt to have something like dabble's imagesize as a node module.