Sobesednik / node-exiftool

A Node.js interface to exiftool command-line application.
MIT License
91 stars 15 forks source link

Doesn't work with await #46

Open strarsis opened 5 years ago

strarsis commented 5 years ago

@z-vr:

const exiftool = require('node-exiftool'),
      ep       = new exiftool.ExiftoolProcess(),

async function test(inputPath) {
    await ep.open();

    try {
        const result = await ep.readMetadata(
            inputPath,
            ['-File:all -dateFormat %Y-%m-%dT%H:%M:%S -datetimeoriginal']
        );
        console.log(result);
    } catch(e) {
        console.error(e);
    }

    await ep.close();
}

test('./test.jpg');

Error:

UnhandledPromiseRejectionWarning: Error: Exiftool process is not open
dminkovsky commented 4 years ago

Seems to work for me.

danielzotti commented 3 years ago

It works for me too (node v14.12.0)

strarsis commented 3 years ago

Maybe it is the node version? I would have to retest it with a recent node LTS.

ElisonSz commented 2 years ago

It works for me ✅

anasshakil commented 1 year ago

Please take a look at my repo. I hope it'll solve your problem Link: https://github.com/anasshakil/metadata