From 2263f412817d6d2d36372e7617feb0d97fa57af8 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 4 Jul 2017 02:11:44 +0200 Subject: break out browser and tasks --- lib/server/index.js | 2 +- lib/worker/processFiles.js | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/server/index.js b/lib/server/index.js index c32dd07..5069478 100644 --- a/lib/server/index.js +++ b/lib/server/index.js @@ -28,7 +28,7 @@ site.init = function(bridge){ constĀ api_folders = crud(app, 'folder', db.Folder, { afterCreate: (folder) => { - fs.mkdir('public/data/' + folder.get('id') + '/', function(){ + fs.mkdir('data/' + folder.get('id') + '/', function(){ console.log('created folder', folder.get('id'), folder.get('name')) }) } diff --git a/lib/worker/processFiles.js b/lib/worker/processFiles.js index 21021b5..bde15ef 100644 --- a/lib/worker/processFiles.js +++ b/lib/worker/processFiles.js @@ -110,7 +110,18 @@ function convertToMp3(fullPath) { }) }) } - +function thumbnailJpeg(fullPath, _w, _h) { + const w = _w || 250 + const h = _h || 250 + return new Promise ( (resolve, reject) => { + console.log('thumbnail jpeg') + const jpegPath = jpegPath + '.jpg' + execFile(process.env.CONVERT_BINARY, [fullPath, '-resize', w + 'x' + h, '-quality', 90, jpegPath], (err, stdout, stderr) => { + // console.log(stdout, stderr) + resolve() + }) + }) +} function processImage(file) { return new Promise ( (resolve, reject) => { // process image? -- cgit v1.2.3-70-g09d2