angular-docs-cn/aio/tools/transforms/angular-base-package/services/getImageDimensions.js

7 lines
200 B
JavaScript

const { resolve } = require('canonical-path');
const sizeOf = require('image-size');
module.exports = function getImageDimensions() {
return (basePath, path) => sizeOf(resolve(basePath, path));
};