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 e373bfc..1890ddc 100644 Binary files a/public/img/template/default.jpg and b/public/img/template/default.jpg differ 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 @@