From 8016246965874cb040a0fbc001cf29265cee8076 Mon Sep 17 00:00:00 2001 From: "P.BARRY" Date: Mon, 13 Jul 2015 12:46:35 +0200 Subject: [PATCH] prebuild during shooting --- app.js | 4 ++-- public/img/template/default.jpg | Bin 126716 -> 54546 bytes tools/tools-gphoto2.js | 13 ++++++++++++- views/index.ejs | 4 ++-- views/view.ejs | 2 +- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index 8eb7cc6..00fa1da 100644 --- a/app.js +++ b/app.js @@ -87,8 +87,8 @@ function BOB_initConfig() { style : 'default', nbPicture : 4, cropSize : { - width : 2000, - height : 2500 + width : 900, + height : 1125 }, pictNames : [], layout : [], diff --git a/public/img/template/default.jpg b/public/img/template/default.jpg index e373bfcac5fa423f68f63a9236f5515d614fa904..1890ddc7b335382ec9638f250b28c7175d2fd0be 100644 GIT binary patch delta 209 zcmex!mwnPI<_V8@&8-ZL6%386j0~&{%s0OOCd9=5aq?^vK+uhSQK*31QLeJ1(GP9TluZfibP`jm-fuWVD#byh!Eo_VilRwB9FdA%D zkzL8c!Wquyu=%3m{qX5$*%_6YmZeW$@QzWMlbMmxp0WNPge%VqVV+}Wlx1hLX99}@ mIdan%a4@m}^=x0y!MHqpdht6(C8!Bt8l;57UI3*0|4jhSC`eQQ delta 245 zcmbQViuuo7_6d)8O{@%z6$~w{3=FMIEjGUYCd9-WIr)Hy$mZX|UCf)6rP5hhj4jNK zCU?sluo#(I8g1SqzmkQ8Ux7r1_I4 z)<_F6GcwvU*8f8lRzgws=8CKUn>`b%qBmFM`4mxvHvg?zj%?eKE2zdytdZvvK+!Sz N%@rkHB%A-=1OQm(c5?s# diff --git a/tools/tools-gphoto2.js b/tools/tools-gphoto2.js index 2b6a1c4..79c3b26 100644 --- a/tools/tools-gphoto2.js +++ b/tools/tools-gphoto2.js @@ -1,3 +1,4 @@ +var BOB_mod_gm = require('gm').subClass({ imageMagick: true }); var BOB_mod_gphoto2 = require('gphoto2'); var BOB_var_gphoto = new BOB_mod_gphoto2.GPhoto2(); var BOB_mod_fs = require('fs'); @@ -10,6 +11,7 @@ var BOB_var_camera = null; var BOB_module = {}; +BOB_upCameraReference(function() {}); function BOB_upCameraReference(pCallback) { // List cameras / assign list item to variable to use below options @@ -48,7 +50,16 @@ BOB_module.takePicture = function(pBoothId, pPictId, pCallback) { } else { BOB_mod_mkdirp(destPath, function() { BOB_mod_fs.writeFile(pictPath, pData, function(pErr) { - return pCallback(pErr, pictPath) + BOB_mod_gm(pictPath) + .autoOrient() + .gravity('Center') + .resize(BOB_cfg_config.cropSize.width, BOB_cfg_config.cropSize.height, "^") + .crop(BOB_cfg_config.cropSize.width, BOB_cfg_config.cropSize.height) + // .modulate(100, 0) + // .contrast(+2) + .write(dstPict, function(pErr) { + return pCallback(pErr, pictPath) + }) }); }) } diff --git a/views/index.ejs b/views/index.ejs index c25ec09..6cff81e 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -60,7 +60,7 @@