From c6798f7a08693dee8fba548a0232e63ae13188e4 Mon Sep 17 00:00:00 2001 From: Flummi Date: Tue, 14 Nov 2017 02:31:18 +0100 Subject: [PATCH] meh --- src/lib.js | 3 +++ src/websrv.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib.js b/src/lib.js index af1eb04..93a8763 100644 --- a/src/lib.js +++ b/src/lib.js @@ -115,6 +115,7 @@ self.generateThumbs = () => { } else exec('convert '+thumbnail+' -resize "128x128^" -gravity center -crop 128x128+0+0 +repage '+thumbnail, (error) => { + if(error) console.log(error); self.log((error?'failed':'generated') + ' thumbnail for '+e.id+' ('+e.mime+')'); }); }); @@ -122,6 +123,7 @@ self.generateThumbs = () => { case "image/png": case "image/jpeg": exec('convert '+e.dest+' -resize "200x200^" -gravity center -crop 128x128+0+0 +repage '+thumbnail, (error) => { + if(error) console.log(error); self.log((error)?'failed thumbnail for '+e.id+' ('+e.mime+')':'generated thumbnail for '+e.id+' ('+e.mime+')'); }); break; @@ -133,6 +135,7 @@ self.generateThumbs = () => { dat.on('finish', () => { dat.close(); exec('convert '+thumbnail+' -resize "200x200^" -gravity center -crop 128x128+0+0 +repage '+thumbnail, (error) => { + if(error) console.log(error); self.log((error)?'failed thumbnail for '+e.id+' ('+e.mime+')':'generated thumbnail for '+e.id+' ('+e.mime+')'); }); }); diff --git a/src/websrv.js b/src/websrv.js index 9d0bf7d..a47948e 100644 --- a/src/websrv.js +++ b/src/websrv.js @@ -213,7 +213,7 @@ function Websrv(tlib) { res.write(file, "binary"); } res.end(); - }); + }); } else { fs.readFile(filePath, (error, content) => { @@ -230,7 +230,7 @@ function Websrv(tlib) { } else { //res.writeHead(200, { 'Content-Type': contentType, 'Content-Length': content.length, 'Cache-Control': 'max-age=2592000, public' }); - res.writeHead(200); + res.writeHead(200); res.end(content, 'utf-8'); } });