Get the width and height of any image on the Internet. Supports BMP, GIF, JPEG, PNG, PSD.
Get the width and height of any image on the Internet. Supports BMP, GIF, JPEG, PNG, PSD.
npm install dimensions --save
Give dimensions an image URL, get back an object with the image's width and height in pixels.
var dimensions = require('dimensions')
var url = 'http://placekitten.com/g/200/300'
dimensions(url, function(err, dimensions){
if (err) throw err
console.log(dimensions)
})
The above yields:
{
height: 300,
width: 200
}
See test/index.js for more usage examples.