spee.ch/server/utils/imageProcessing.js
2018-07-31 09:05:39 -07: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,
};