GenderDysphoria.fyi/build/lib/dimensions.js
Jocelyn Badgley (Twipped) a83bbdd885 Added support for svgs
2021-03-23 09:29:11 -07:00

11 lines
304 B
JavaScript

var { promisify } = require('util');
var { extname } = require('path');
var svgDim = promisify(require('svg-dimensions').get);
var imgDim = promisify(require('image-size'));
module.exports = exports = async (fpath) => {
if (extname(fpath) === '.svg') return svgDim(fpath);
return imgDim(fpath);
};