GenderDysphoria.fyi/build/lib/dimensions.js

11 lines
304 B
JavaScript
Raw Normal View History

2020-02-20 14:38:25 -08:00
var { promisify } = require('util');
2021-03-22 18:26:13 -07:00
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);
};