dimensions
v0.1.0
Published
Get the width and height of any image on the Internet. Supports BMP, GIF, JPEG, PNG, PSD.
Downloads
106
Maintainers
Readme
dimensions
Get the width and height of any image on the Internet. Supports BMP, GIF, JPEG, PNG, PSD.
Install it
npm install dimensions --save
Use it
Give dimensions an image URL, get back an object with the image's width and height in pixels.
var dimensions = require('dimensions')
dimensions('http://upload.wikimedia.org/wikipedia/en/7/70/Example.png', function(err, dimensions){
if (err) throw err
console.log(dimensions)
})
The above yields:
{
height: 297,
width: 275
}
See tests/index.js for more usage examples.