removes image-size in favor of probe-image-size to handle CMYK jpgs
This commit is contained in:
@@ -129,6 +129,7 @@ async function create(args) {
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
throw new FileUploadError(err);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user