base64image-dimensions
Version:
Dimensions of Base64 image
22 lines (11 loc) • 475 B
Markdown
# Description
Get the image dimensions and image type of a base64 Image.
# Installation
`npm install base64image-dimensions --save`
# Usage
```
const imageInfo = require("base64image-dimensions");
base64Image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII'; // any base64 image
let info = imageInfo(base64Image);
console.log(info.height, info.width, info.type);
```