diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-07-04 02:11:44 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-07-04 02:11:44 +0200 |
| commit | 2263f412817d6d2d36372e7617feb0d97fa57af8 (patch) | |
| tree | c5bc7fd177636a295a508c12e1cc2d703c252056 /lib | |
| parent | 0075896decfe2ebf81c2610f4367929c0d51b1d8 (diff) | |
break out browser and tasks
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/server/index.js | 2 | ||||
| -rw-r--r-- | lib/worker/processFiles.js | 13 |
2 files changed, 13 insertions, 2 deletions
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? |
