diff --git a/ghost/core/core/server/data/importer/handlers/image.js b/ghost/core/core/server/data/importer/handlers/image.js index d927c78ef5..f715abf47d 100644 --- a/ghost/core/core/server/data/importer/handlers/image.js +++ b/ghost/core/core/server/data/importer/handlers/image.js @@ -1,5 +1,4 @@ const _ = require('lodash'); -const Promise = require('bluebird'); const path = require('path'); const config = require('../../../../shared/config'); const urlUtils = require('../../../../shared/url-utils'); @@ -35,14 +34,14 @@ ImageHandler = { return file; }); - return Promise.map(files, function (image) { + return Promise.all(files.map(function (image) { return store.getUniqueFileName(image, image.targetDir).then(function (targetFilename) { image.newPath = urlUtils.urlJoin('/', urlUtils.getSubdir(), urlUtils.STATIC_IMAGE_URL_PREFIX, path.relative(config.getContentPath('images'), targetFilename)); return image; }); - }); + })); } }; diff --git a/ghost/core/core/server/data/importer/importers/image.js b/ghost/core/core/server/data/importer/importers/image.js index 63e74597bf..8a094f3184 100644 --- a/ghost/core/core/server/data/importer/importers/image.js +++ b/ghost/core/core/server/data/importer/importers/image.js @@ -1,5 +1,4 @@ const _ = require('lodash'); -const Promise = require('bluebird'); const storage = require('../../../adapters/storage'); let replaceImage; let ImageImporter; @@ -66,11 +65,11 @@ ImageImporter = { doImport: function (imageData) { const store = storage.getStorage('images'); - return Promise.map(imageData, function (image) { + return Promise.all(imageData.map(function (image) { return store.save(image, image.targetDir).then(function (result) { return {originalPath: image.originalPath, newPath: image.newPath, stored: result}; }); - }); + })); } };