Open digitalnature opened 6 years ago
The problem seems to be the splitting by space from the getArgs function: https://github.com/Sobesednik/node-exiftool/blob/e4a8fb7c129de38d7a87f02a471ec17577af4f15/src/lib.js#L48
Replacing it with this fixes it:
[].concat(acc, noSplit ? [arg] : arg.match(/\\?.|^$/g).reduce((p, c) => {
if(c === '"'){
p.quote ^= 1;
}else if(!p.quote && c === ' '){
p.a.push('');
}else{
p.a[p.a.length - 1] += c.replace(/\\(.)/, "$1");
}
return p;
}, {a: ['']}).a)
I'm using it like this and it's working:
ep.readMetadata(path, ['json', 'd %s', 'c %.6f', 'Orientation#', 'all'])
it looks like some arguments are not supported, like "c" (coordFormat)
ep.readMetadata(path, ['j', 'n', 'c "%d %d %.8f"', 'fast2']).then(...
will make exiftool believe that %d is a file and throw a
'File not found: %d'
error