Merge pull request #550 from lbryio/remove-imagemagick
removed imagemagick npm package
This commit is contained in:
commit
c22798223d
3 changed files with 0 additions and 31 deletions
5
package-lock.json
generated
5
package-lock.json
generated
|
@ -4395,11 +4395,6 @@
|
|||
"resolved": "https://registry.npmjs.org/image-size/-/image-size-0.6.3.tgz",
|
||||
"integrity": "sha512-47xSUiQioGaB96nqtp5/q55m0aBQSQdyIloMOc/x+QVTDZLNmXE892IIDrJ0hM1A5vcNUDD5tDffkSP5lCaIIA=="
|
||||
},
|
||||
"imagemagick": {
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/imagemagick/-/imagemagick-0.1.3.tgz",
|
||||
"integrity": "sha1-dIPOoJO02fLi85aFetyIIbU3xWo="
|
||||
},
|
||||
"import-lazy": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz",
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
"get-video-dimensions": "^1.0.0",
|
||||
"helmet": "^3.8.1",
|
||||
"image-size": "^0.6.3",
|
||||
"imagemagick": "^0.1.3",
|
||||
"module-alias": "^2.0.6",
|
||||
"mysql2": "^1.3.5",
|
||||
"passport": "^0.4.0",
|
||||
|
|
|
@ -1,28 +1,5 @@
|
|||
const imageMagick = require('imagemagick');
|
||||
const sizeOf = require('image-size');
|
||||
|
||||
const getImageMetadata = (filePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
imageMagick.readMetadata(filePath, (err, metadata) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
}
|
||||
resolve(metadata);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const getImageDetails = (filePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
imageMagick.identify(filePath, (err, details) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
}
|
||||
resolve(details);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const getImageHeightAndWidth = (filePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
|
@ -35,7 +12,5 @@ const getImageHeightAndWidth = (filePath) => {
|
|||
};
|
||||
|
||||
module.exports = {
|
||||
getImageMetadata,
|
||||
getImageDetails,
|
||||
getImageHeightAndWidth,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue