Skip to content

Commit

Permalink
refactoring: removing the thumbnail creation on every image
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybesson committed Oct 21, 2017
1 parent e2e10fb commit 6029567
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/cli/cms/media/image.js
Expand Up @@ -184,11 +184,11 @@ export function saveFile(req) {
resp = abeExtend.hooks.instance.trigger('afterSaveImage', resp, req)

if (mediaType === 'image') {
var thumbPromise = generateThumbnail(filePath)
thumbPromise.then(function(thumbResp) {
resp.thumbnail = /^win/.test(process.platform)
? thumbResp.thumb.replace(/\\/g, '/')
: thumbResp.thumb
// var thumbPromise = generateThumbnail(filePath)
// thumbPromise.then(function(thumbResp) {
// resp.thumbnail = /^win/.test(process.platform)
// ? thumbResp.thumb.replace(/\\/g, '/')
// : thumbResp.thumb
if (
req &&
req.query &&
Expand All @@ -213,7 +213,7 @@ export function saveFile(req) {
resolve(resp)
})
} else resolve(resp)
})
//})
} else {
resolve(resp)
}
Expand Down
9 changes: 5 additions & 4 deletions src/server/routes/post-upload.js
Expand Up @@ -8,10 +8,11 @@ var route = function(req, res, next) {

image
.then(function(resp) {
Manager.instance.addThumbsToList({
originalFile: resp.filePath,
thumbFile: resp.thumbnail
})
// This shoulb be put in the gallery plugin
// Manager.instance.addThumbsToList({
// originalFile: resp.filePath,
// thumbFile: resp.thumbnail
// })
res.set('Content-Type', 'application/json')
res.send(JSON.stringify(resp))
})
Expand Down

0 comments on commit 6029567

Please sign in to comment.