simple-image-size
v0.1.3
Published
Amazing! This package is what i use to verify an image's width and height in a very simple step.
Downloads
2
Maintainers
Readme
Simple Image Size Package User Guide
Amazing! This package is what i use to verify an image's width and height in a very simple step.
You are requiring the getImageSize() and simply pass in your image file.
I would create a demo page to place here soon ... Demo
Install
Add the Package using npm
To install, use:
npm install simple-image-size # or yarn simple-image-size
Usage
First Import the package, import getImageSize from 'simple-image-size'
or Import the package, const getImageSize = require('simple-image-size')
The is an async operation so you can use async/await or then/catch to get a promise Object with the image's width and height. You can use it by passing the image file as the only parameter to getImageSize(file)
.
Tested images
valid IAB images
is tested for jpg, png, gif
.
stay in touch
I recomment contacting me on twitter twitter.