spee.ch/server/utils/imageProcessing.js
2019-04-18 11:51:21 -04:00

16 lines
329 B
JavaScript

const sizeOf = require('image-size');
const getImageHeightAndWidth = (filePath) => {
return new Promise((resolve, reject) => {
try {
const { height, width } = sizeOf(filePath);
resolve([height, width]);
} catch (error) {
reject(error);
}
});
};
module.exports = {
getImageHeightAndWidth,
};