showing results for - "width and height with node js"
Gino
23 Oct 2019
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
Sabri
27 Oct 2018
1var sizeOf = require('image-size');
2sizeOf('images/funny-cats.png', function (err, dimensions) {
3  console.log(dimensions.width, dimensions.height);
4});
5