import _ from 'lodash';
import { buildCommandSequence, getCommand, } from '../../../../code/tool/shared/command.js';
export function buildCommandToInspectMetadataFromImage(input) {
    const cmd = getCommand('exiftool');
    cmd.link.push(`"${input.input.file.path}"`);
    return buildCommandSequence(cmd);
}
export function parseImageMetadataFromExifTool(lines) {
    const metadata = [];
    lines.forEach(line => {
        const pieces = line.split(': ');
        //Is this a line with a meta data pair on it?
        if (pieces.length == 2) {
            const name = _.camelCase(pieces[0].trim());
            let bond = pieces[1].trim();
            const number = parseFloat(bond);
            if (!Number.isNaN(number)) {
                bond = number;
            }
            metadata.push({ name, bond });
        }
    });
    return metadata;
}
//# sourceMappingURL=command.js.map