UNPKG

base64image-dimensions

Version:

Dimensions of Base64 image

14 lines (12 loc) 540 B
var assert = require('assert'); const fs = require('fs'); const imageInfo = require('../index') describe('should return the image dimesions and type', function () { it('should return the correct height, width and type for the base64image', function () { let data = fs.readFileSync('./test/base64image1.txt', {encoding:'utf8', flag:'r'}); // console.log(imageInfo(data)); assert.equal(435, imageInfo(data).height); assert.equal(600, imageInfo(data).width); assert.equal('jpg', imageInfo(data).type); }); });