@aulamejor/size-of
v1.0.0-3
Published
Get the dimensions of any image
Downloads
5
Readme
size-of
A Node module to get dimensions of any image file
Supported formats
- GIF
- JPEG
- PNG
- SVG
Usage
npm install @aulamejor/size-of --save
var sizeOf = require("@aulamejor/size-of");
try {
const dimensions = await sizeOf("images/funny-cats.png");
console.log(dimensions.width, dimensions.height);
} catch (err) {
console.error(err);
}
Using a URL
const sizeOf = require("@aulamejor/size-of");
const url = "http://my-amazing-website.com/image.jpeg";
const dimensions = await sizeOf(url);
console.log(dimensions.width, dimensions.height);