From e80a20d7c80673534a8a2fcd8035c073a1d227a4 Mon Sep 17 00:00:00 2001 From: Vlad Tsepelev Date: Wed, 27 May 2015 18:40:06 +0300 Subject: [PATCH 1/2] add additional param to pass arguments to exif --- index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index ef69b55..01b74c1 100644 --- a/index.js +++ b/index.js @@ -15,15 +15,23 @@ var command = require('shelly'); * @api public */ -module.exports = function(file, execOpts, fn){ +module.exports = function(file, execOpts, commandOpts, fn){ // rationalize options if(typeof execOpts === 'function') { fn = execOpts; execOpts = {}; + commandOpts = ''; } + + if(typeof commandOpts === 'function') { + fn = commandOpts; + commandOpts = ''; + } + // REM : exiftool options http://www.sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html // -json : ask JSON output - var cmd = command('exiftool -json ?', file); + var cmd = command('exiftool -json '+commandOpts+' ? ', file); + console.log(cmd) exec(cmd, execOpts, function(err, str) { if(err) { From 9c090790431912147b621c69ac8976b34e53a8d5 Mon Sep 17 00:00:00 2001 From: Vlad Tsepelev Date: Wed, 27 May 2015 18:52:25 +0300 Subject: [PATCH 2/2] remove extra log --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 01b74c1..1ac0fa9 100644 --- a/index.js +++ b/index.js @@ -31,7 +31,7 @@ module.exports = function(file, execOpts, commandOpts, fn){ // REM : exiftool options http://www.sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html // -json : ask JSON output var cmd = command('exiftool -json '+commandOpts+' ? ', file); - console.log(cmd) + exec(cmd, execOpts, function(err, str) { if(err) {