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/worker/processFiles.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/worker') 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