From 4baf06a57b039853d7d15fceb56a8b2442437275 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Tue, 31 Jul 2018 09:05:39 -0700 Subject: [PATCH] removed imagemagick npm package --- package-lock.json | 5 ----- package.json | 1 - server/utils/imageProcessing.js | 25 ------------------------- 3 files changed, 31 deletions(-) diff --git a/package-lock.json b/package-lock.json index 38f430f1..543859b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index 545741e1..85da362c 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/server/utils/imageProcessing.js b/server/utils/imageProcessing.js index 370530f6..45e21a76 100644 --- a/server/utils/imageProcessing.js +++ b/server/utils/imageProcessing.js @@ -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, };