1gm = require('gm');
2
3// obtain the size of an image
4gm('test.jpg')
5.size(function (err, size) {
6 if (!err) {
7 console.log('width = ' + size.width);
8 console.log('height = ' + size.height);
9 }
10});
11
1var sizeOf = require('image-size');
2sizeOf('images/funny-cats.png', function (err, dimensions) {
3 console.log(dimensions.width, dimensions.height);
4});
5