base64image-dimensions
v1.0.6
Published
Dimensions of Base64 image
Downloads
26
Maintainers
Readme
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);