Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with spaces in extra arguments? #43

Open
digitalnature opened this issue May 20, 2018 · 3 comments
Open

Issue with spaces in extra arguments? #43

digitalnature opened this issue May 20, 2018 · 3 comments

Comments

@digitalnature
Copy link

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

@digitalnature
Copy link
Author

digitalnature commented May 20, 2018

The problem seems to be the splitting by space from the getArgs function:

[].concat(acc, noSplit ? [arg] : arg.split(/\s+/))

@digitalnature
Copy link
Author

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)

@ChenAlon
Copy link

ChenAlon commented Dec 2, 2019

I'm using it like this and it's working:
ep.readMetadata(path, ['json', 'd %s', 'c %.6f', 'Orientation#', 'all'])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants