|
|
@ -1,3 +1,4 @@ |
|
|
|
|
|
var BOB_mod_gm = require('gm').subClass({ imageMagick: true }); |
|
|
var BOB_mod_gphoto2 = require('gphoto2'); |
|
|
var BOB_mod_gphoto2 = require('gphoto2'); |
|
|
var BOB_var_gphoto = new BOB_mod_gphoto2.GPhoto2(); |
|
|
var BOB_var_gphoto = new BOB_mod_gphoto2.GPhoto2(); |
|
|
var BOB_mod_fs = require('fs'); |
|
|
var BOB_mod_fs = require('fs'); |
|
|
@ -10,6 +11,7 @@ var BOB_var_camera = null; |
|
|
|
|
|
|
|
|
var BOB_module = {}; |
|
|
var BOB_module = {}; |
|
|
|
|
|
|
|
|
|
|
|
BOB_upCameraReference(function() {}); |
|
|
|
|
|
|
|
|
function BOB_upCameraReference(pCallback) { |
|
|
function BOB_upCameraReference(pCallback) { |
|
|
// List cameras / assign list item to variable to use below options
|
|
|
// List cameras / assign list item to variable to use below options
|
|
|
@ -48,7 +50,16 @@ BOB_module.takePicture = function(pBoothId, pPictId, pCallback) { |
|
|
} else { |
|
|
} else { |
|
|
BOB_mod_mkdirp(destPath, function() { |
|
|
BOB_mod_mkdirp(destPath, function() { |
|
|
BOB_mod_fs.writeFile(pictPath, pData, function(pErr) { |
|
|
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) |
|
|
|
|
|
}) |
|
|
}); |
|
|
}); |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|