const getImageSize = require('image-size'); const { svg, xlink } = require('../../namespaces'); /** * TODO rasterToSVG#getPixelRatioFromFilename * @param {Buffer} buffer * @return {string} */ function rasterToSVG(buffer) { const info = getImageSize(buffer); const { width, height, type } = info; const defaultNS = `${svg.name}="${svg.uri}"`; const xlinkNS = `${xlink.name}="${xlink.uri}"`; const data = `data:image/${type};base64,${buffer.toString('base64')}`; return [ ``, ``, '' ].join(''); } module.exports = rasterToSVG;