plotly.js
Version:
The open source javascript graphing library that powers plotly
12 lines (9 loc) • 369 B
JavaScript
var probeSync = require('probe-image-size/sync');
var dataUri = require('../../snapshot/helpers').IMAGE_URL_PREFIX;
var Buffer = require('buffer/').Buffer; // note: the trailing slash is important!
exports.getImageSize = function(src) {
var data = src.replace(dataUri, '');
var buff = new Buffer(data, 'base64');
return probeSync(buff);
};
;