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
Add the Package using npm
To install, use:
npm install simple-image-size # or yarn simple-image-size
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)
.
valid IAB images
is tested for jpg, png, gif
.
I recomment contacting me on twitter twitter.