removes image-size in favor of probe-image-size to handle CMYK jpgs

This commit is contained in:
James
2020-10-07 16:52:48 -04:00
parent 9aeab9548d
commit 91016ec206
4 changed files with 34 additions and 7 deletions

View File

@@ -1,6 +1,9 @@
const imageSize = require('image-size');
const { promisify } = require('util');
const fs = require('fs');
const probeImageSize = require('probe-image-size');
const getImageSize = promisify(imageSize);
const getImageSize = async (path) => {
const image = fs.createReadStream(path);
return probeImageSize(image);
};
module.exports = getImageSize;