Sobesednik / node-exiftool

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

When exiftool process is killed, readMetadata hangs #32

Closed mika-fischer closed 7 years ago

mika-fischer commented 7 years ago

I think the problem might be a race between the the process exiting and the exit listener being installed. Ideally, the exit listener should be installed in the same tick as the child_process.spawn, then this could never happen.

I'm basically doing (for a lot of files):

const etp = new exiftool.ExiftoolProcess(exiftoolBin);
await etp.open();
const metadata = await etp.readMetadata(filename); // This hangs if exiftool process is killed

and on the terminal:

taskkill /F /IM exiftool.exe

I do realize now that I don't actually need to spawn a new process for each image, so I'll see if I can work around it that way. This is still worth fixing though...

z-vr commented 7 years ago

@mika-fischer Fixed in 2.3.0, thanks for reporting.