summaryrefslogtreecommitdiff
path: root/lib/worker
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-07-04 02:11:44 +0200
committerJules Laplace <julescarbon@gmail.com>2017-07-04 02:11:44 +0200
commit2263f412817d6d2d36372e7617feb0d97fa57af8 (patch)
treec5bc7fd177636a295a508c12e1cc2d703c252056 /lib/worker
parent0075896decfe2ebf81c2610f4367929c0d51b1d8 (diff)
break out browser and tasks
Diffstat (limited to 'lib/worker')
-rw-r--r--lib/worker/processFiles.js13
1 files changed, 12 insertions, 1 deletions
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?