Browse Source

prebuild during shooting

bob
P.BARRY 10 years ago
parent
commit
8016246965
5 changed files with 17 additions and 6 deletions
  1. 4
      app.js
  2. BIN
      public/img/template/default.jpg
  3. 13
      tools/tools-gphoto2.js
  4. 4
      views/index.ejs
  5. 2
      views/view.ejs

4
app.js

@ -87,8 +87,8 @@ function BOB_initConfig() {
style : 'default', style : 'default',
nbPicture : 4, nbPicture : 4,
cropSize : { cropSize : {
width : 2000,
height : 2500
width : 900,
height : 1125
}, },
pictNames : [], pictNames : [],
layout : [], layout : [],

BIN
public/img/template/default.jpg

Before After
Width: 2592  |  Height: 3872  |  Size: 124 KiB Width: 1600  |  Height: 2391  |  Size: 53 KiB

13
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_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)
})
}); });
}) })
} }

4
views/index.ejs

@ -60,7 +60,7 @@
<script type="text/javascript"> <script type="text/javascript">
var socket = io('http://192.168.1.15:3000');
var socket = io('http://<%= serverIpAddress %>:3000');
socket.on('connect', function() { socket.on('connect', function() {
console.log("connect") console.log("connect")
@ -125,7 +125,7 @@ function BOB_countdown() {
function BOB_displayPictPreview(pBoothId, pPictureId, pCallback) { function BOB_displayPictPreview(pBoothId, pPictureId, pCallback) {
$('#idViewCountdown').html(""); $('#idViewCountdown').html("");
$('#idPictPreview > img').attr('src', '/img/original/'+pBoothId+'/pict_'+pPictureId+'.jpg');
$('#idPictPreview > img').attr('src', '/img/prebuilt/'+pBoothId+'/pict_'+pPictureId+'.jpg');
$('#idBoothPanel').fadeOut(50, function() { $('#idBoothPanel').fadeOut(50, function() {
$('#idPictPreview').show(); $('#idPictPreview').show();
setTimeout(function() { setTimeout(function() {

2
views/view.ejs

@ -40,7 +40,7 @@ socket.on('boothState', function (data) {
$(document).ready(function() { $(document).ready(function() {
BOB_getBooths(); BOB_getBooths();
if( $(window).width() < 400 ) {
if( $(window).width() < 500 ) {
$('#idMain').css('width' ,'100%'); $('#idMain').css('width' ,'100%');
} }
}) })

Loading…
Cancel
Save